From 1acacc3b8091d3a7cb409477262c0b48a1ddafe1 Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 12 Oct 2008 14:31:28 +0000 Subject: [PATCH] added new welcome_demo.php page added agc_sk directory for new Slovak agent translation changed _en directories to redirects that go to main agc and vicidial web directories language translation files corrections git-svn-id: svn://192.168.202.10@972 3d104415-ff17-0410-8863-d5cf3c621b8a --- LANG_www/agc_en/active_list_refresh.php | 482 - LANG_www/agc_en/astguiclient.php | 2905 ---- LANG_www/agc_en/call_log_display.php | 196 - LANG_www/agc_en/conf_exten_check.php | 297 - LANG_www/agc_en/dbconnect.php | 48 - LANG_www/agc_en/inbound_popup.php | 351 - LANG_www/agc_en/live_exten_check.php | 278 - LANG_www/agc_en/manager_send.php | 1142 -- LANG_www/agc_en/park_calls_display.php | 146 - LANG_www/agc_en/vdc_db_query.php | 2535 --- LANG_www/agc_en/vicidial.php | 6788 +------- LANG_www/agc_en/voicemail_check.php | 140 - LANG_www/vicidial_en/AST_CLOSERstats.php | 617 - LANG_www/vicidial_en/AST_VDADstats.php | 647 - .../vicidial_en/AST_VICIDIAL_hopperlist.php | 169 - .../vicidial_en/AST_admin_log_display.php | 118 - .../vicidial_en/AST_agent_disposition.php | 237 - .../vicidial_en/AST_agent_performance.php | 257 - .../AST_agent_performance_detail.php | 557 - LANG_www/vicidial_en/AST_agent_time_sheet.php | 286 - .../AST_agent_time_sheet_archive.php | 286 - LANG_www/vicidial_en/AST_inboundEXTstats.php | 400 - .../AST_inboundEXTstats_department.php | 178 - .../vicidial_en/AST_server_performance.php | 306 - LANG_www/vicidial_en/AST_timeonVDAD.php | 374 - .../vicidial_en/AST_timeonVDAD_closer.php | 318 - LANG_www/vicidial_en/AST_timeonVDADall.php | 826 - LANG_www/vicidial_en/AST_timeonVDADallREC.php | 943 -- .../vicidial_en/AST_timeonVDADallSUMMARY.php | 442 - LANG_www/vicidial_en/AST_timeoncall.php | 180 - LANG_www/vicidial_en/AST_timeonpark.php | 219 - LANG_www/vicidial_en/admin.php | 13590 +--------------- LANG_www/vicidial_en/admin_modify_lead.php | 610 - LANG_www/vicidial_en/admin_search_lead.php | 225 - LANG_www/vicidial_en/count.htm | 1 - LANG_www/vicidial_en/dbconnect.php | 49 - LANG_www/vicidial_en/group_hourly_stats.php | 252 - LANG_www/vicidial_en/help.gif | Bin 492 -> 0 bytes LANG_www/vicidial_en/listloader.php | 926 -- LANG_www/vicidial_en/listloader.pl | 1084 -- LANG_www/vicidial_en/listloaderMAIN.php | 86 - LANG_www/vicidial_en/listloader_rowdisplay.pl | 153 - LANG_www/vicidial_en/listloader_super.pl | 1086 -- .../vicidial_en/new_listloader_superL.php | 2069 --- LANG_www/vicidial_en/remote_dispo.php | 327 - LANG_www/vicidial_en/server_stats.php | 97 - LANG_www/vicidial_en/user_stats.php | 408 - LANG_www/vicidial_en/user_status.php | 242 - LANG_www/vicidial_en/vdremote.php | 602 - LANG_www/vicidial_en/voice_lab.php | 312 - LANG_www/vicidial_en/vtiger_search.php | 313 - LANG_www/vicidial_en/welcome.php | 25 - translations/de_language.txt | 4 +- translations/sk_language.txt | 4 +- www/vicidial/welcome_demo.php | 76 + 55 files changed, 112 insertions(+), 45097 deletions(-) delete mode 100644 LANG_www/agc_en/active_list_refresh.php delete mode 100644 LANG_www/agc_en/astguiclient.php delete mode 100644 LANG_www/agc_en/call_log_display.php delete mode 100644 LANG_www/agc_en/conf_exten_check.php delete mode 100644 LANG_www/agc_en/dbconnect.php delete mode 100644 LANG_www/agc_en/inbound_popup.php delete mode 100644 LANG_www/agc_en/live_exten_check.php delete mode 100644 LANG_www/agc_en/manager_send.php delete mode 100644 LANG_www/agc_en/park_calls_display.php delete mode 100644 LANG_www/agc_en/vdc_db_query.php delete mode 100644 LANG_www/agc_en/voicemail_check.php delete mode 100644 LANG_www/vicidial_en/AST_CLOSERstats.php delete mode 100644 LANG_www/vicidial_en/AST_VDADstats.php delete mode 100644 LANG_www/vicidial_en/AST_VICIDIAL_hopperlist.php delete mode 100644 LANG_www/vicidial_en/AST_admin_log_display.php delete mode 100644 LANG_www/vicidial_en/AST_agent_disposition.php delete mode 100644 LANG_www/vicidial_en/AST_agent_performance.php delete mode 100644 LANG_www/vicidial_en/AST_agent_performance_detail.php delete mode 100644 LANG_www/vicidial_en/AST_agent_time_sheet.php delete mode 100644 LANG_www/vicidial_en/AST_agent_time_sheet_archive.php delete mode 100644 LANG_www/vicidial_en/AST_inboundEXTstats.php delete mode 100644 LANG_www/vicidial_en/AST_inboundEXTstats_department.php delete mode 100644 LANG_www/vicidial_en/AST_server_performance.php delete mode 100644 LANG_www/vicidial_en/AST_timeonVDAD.php delete mode 100644 LANG_www/vicidial_en/AST_timeonVDAD_closer.php delete mode 100644 LANG_www/vicidial_en/AST_timeonVDADall.php delete mode 100644 LANG_www/vicidial_en/AST_timeonVDADallREC.php delete mode 100644 LANG_www/vicidial_en/AST_timeonVDADallSUMMARY.php delete mode 100644 LANG_www/vicidial_en/AST_timeoncall.php delete mode 100644 LANG_www/vicidial_en/AST_timeonpark.php delete mode 100644 LANG_www/vicidial_en/admin_modify_lead.php delete mode 100644 LANG_www/vicidial_en/admin_search_lead.php delete mode 100644 LANG_www/vicidial_en/count.htm delete mode 100644 LANG_www/vicidial_en/dbconnect.php delete mode 100644 LANG_www/vicidial_en/group_hourly_stats.php delete mode 100644 LANG_www/vicidial_en/help.gif delete mode 100644 LANG_www/vicidial_en/listloader.php delete mode 100644 LANG_www/vicidial_en/listloader.pl delete mode 100644 LANG_www/vicidial_en/listloaderMAIN.php delete mode 100644 LANG_www/vicidial_en/listloader_rowdisplay.pl delete mode 100644 LANG_www/vicidial_en/listloader_super.pl delete mode 100644 LANG_www/vicidial_en/new_listloader_superL.php delete mode 100644 LANG_www/vicidial_en/remote_dispo.php delete mode 100644 LANG_www/vicidial_en/server_stats.php delete mode 100644 LANG_www/vicidial_en/user_stats.php delete mode 100644 LANG_www/vicidial_en/user_status.php delete mode 100644 LANG_www/vicidial_en/vdremote.php delete mode 100644 LANG_www/vicidial_en/voice_lab.php delete mode 100644 LANG_www/vicidial_en/vtiger_search.php delete mode 100644 LANG_www/vicidial_en/welcome.php create mode 100644 www/vicidial/welcome_demo.php diff --git a/LANG_www/agc_en/active_list_refresh.php b/LANG_www/agc_en/active_list_refresh.php deleted file mode 100644 index 7ea0bff0..00000000 --- a/LANG_www/agc_en/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_en/astguiclient.php b/LANG_www/agc_en/astguiclient.php deleted file mode 100644 index ac01f994..00000000 --- a/LANG_www/agc_en/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 "
English Español
\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 "
English Español
\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 "
English Español
\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_en/call_log_display.php b/LANG_www/agc_en/call_log_display.php deleted file mode 100644 index 28d3ea87..00000000 --- a/LANG_www/agc_en/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_en/conf_exten_check.php b/LANG_www/agc_en/conf_exten_check.php deleted file mode 100644 index ae3b84b5..00000000 --- a/LANG_www/agc_en/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_en/dbconnect.php b/LANG_www/agc_en/dbconnect.php deleted file mode 100644 index 7221b35e..00000000 --- a/LANG_www/agc_en/dbconnect.php +++ /dev/null @@ -1,48 +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'; - -?> diff --git a/LANG_www/agc_en/inbound_popup.php b/LANG_www/agc_en/inbound_popup.php deleted file mode 100644 index c92583de..00000000 --- a/LANG_www/agc_en/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_en/live_exten_check.php b/LANG_www/agc_en/live_exten_check.php deleted file mode 100644 index 3dadf572..00000000 --- a/LANG_www/agc_en/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_en/manager_send.php b/LANG_www/agc_en/manager_send.php deleted file mode 100644 index 94eff7b6..00000000 --- a/LANG_www/agc_en/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_en/park_calls_display.php b/LANG_www/agc_en/park_calls_display.php deleted file mode 100644 index 872f5780..00000000 --- a/LANG_www/agc_en/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_en/vdc_db_query.php b/LANG_www/agc_en/vdc_db_query.php deleted file mode 100644 index 129af642..00000000 --- a/LANG_www/agc_en/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_en/vicidial.php b/LANG_www/agc_en/vicidial.php index 21a2c4e6..3881d790 100644 --- a/LANG_www/agc_en/vicidial.php +++ b/LANG_www/agc_en/vicidial.php @@ -1,300 +1,4 @@ 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='@'; @@ -310,6488 +14,16 @@ if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} 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); +$agcDIR = eregi_replace('agc_en/vicidial.php','agc',$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"; +header("Location: $agcDIR/vicidial.php"); +echo"\n"; +echo"\n"; +echo"\n"; +echo"\n"; +echo"\n"; +echo"click here to continue. . .\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 "
English Español
\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 "
English Español
\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 "
English Español
\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 "
English Español
\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 "\n"; echo "
English Español
\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 "
English Español
\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 "
English Español
\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 "\n"; echo "
English Español
\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 "\n"; echo "
English Español
\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";} -?> - -
-
- -
-
> - 
- - - - - - - - - - - - +?> \ No newline at end of file diff --git a/LANG_www/agc_en/voicemail_check.php b/LANG_www/agc_en/voicemail_check.php deleted file mode 100644 index 0aa152d7..00000000 --- a/LANG_www/agc_en/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/vicidial_en/AST_CLOSERstats.php b/LANG_www/vicidial_en/AST_CLOSERstats.php deleted file mode 100644 index ec53f93f..00000000 --- a/LANG_www/vicidial_en/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_en/AST_VDADstats.php b/LANG_www/vicidial_en/AST_VDADstats.php deleted file mode 100644 index d8afbdd6..00000000 --- a/LANG_www/vicidial_en/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_en/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_en/AST_VICIDIAL_hopperlist.php deleted file mode 100644 index a30832be..00000000 --- a/LANG_www/vicidial_en/AST_VICIDIAL_hopperlist.php +++ /dev/null @@ -1,169 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60619-1654 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 70115-1614 - Added ALT field for vicidial_hopper alt_dial column -# 71029-0852 - Added list_id to the output -# 71030-2118 - Added priority to display -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["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' and modify_campaigns='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!isset($group)) {$group = '';} -if (!isset($query_date)) {$query_date = $NOW_DATE;} -if (!isset($server_ip)) {$server_ip = '10.10.10.15';} - -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$campaigns_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $campaigns_to_print) - { - $row=mysql_fetch_row($rslt); - $campaign_id[$i] =$row[0]; - $campaign_name[$i] =$row[1]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Hopper List\n"; -echo "
\n"; -#echo "\n"; -#echo "\n"; -echo "\n"; -echo "\n"; -echo "           MODIFY \n"; -echo "
\n\n"; - -echo "
\n\n";
-
-
-if (!$group)
-{
-echo "\n\n";
-echo "PLEASE SELECT A CAMPAIGN ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "VICIDIAL: Live Current Hopper List                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-
-echo "Total leads in hopper right now:       $TOTALcalls\n";
-
-
-##############################
-#########  LEAD STATS
-
-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 "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\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;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$FMT_i =		sprintf("%-4s", $i);
-	$lead_id =		sprintf("%-9s", $row[0]);
-	$phone_number =	sprintf("%-10s", $row[1]);
-	$state =		sprintf("%-5s", $row[2]);
-	$status =		sprintf("%-6s", $row[3]);
-	$count =		sprintf("%-5s", $row[4]);
-	$gmt =			sprintf("%-6s", $row[5]);
-	$hopper_id =	sprintf("%-6s", $row[6]);
-	$alt_dial =		sprintf("%-5s", $row[7]);
-	$list_id =		sprintf("%-10s", $row[8]);
-	$priority =		sprintf("%-6s", $row[9]);
-
-if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";}
-else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";}
-
-	$i++;
-	}
-
-echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n";
-
-
-}
-
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial_en/AST_admin_log_display.php b/LANG_www/vicidial_en/AST_admin_log_display.php deleted file mode 100644 index 9c5c4af6..00000000 --- a/LANG_www/vicidial_en/AST_admin_log_display.php +++ /dev/null @@ -1,118 +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["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); -$query_date = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$query_date); - -# AST GUI database administration -# AST_admin_log_display.php -# -# CHANGES -# 50325-0932 - First build -# 51123-1443 - removed globals=on requirement -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60620-1044 - Added variable filtering to eliminate SQL injection attack threat -# - -$version = '0.0.4'; -$build = '60620-1044'; - -$STARTtime = date("U"); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 8 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "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); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "VICIDIAL ADMIN LOG DISPLAY"; -echo "\n"; - -# Fri, 25 Mar 2005 - -$DAY_DATE = date("j"); -if ($DAY_DATE < 10) -# {$GREP_DATE = date("D, j M Y");} - {$GREP_DATE = date("D, 0j M Y");} -else - {$GREP_DATE = date("D, j M Y");} - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -if (!$query_date) {$query_date = $GREP_DATE;} - -$Gquery_date = eregi_replace(" ",'\ ',$query_date); -echo "\n"; - -echo "
\n"; -echo "\n"; -echo "\n"; -echo "
\n\n"; - -echo "
\n\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");
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial_en/AST_agent_disposition.php b/LANG_www/vicidial_en/AST_agent_disposition.php deleted file mode 100644 index b0b0a461..00000000 --- a/LANG_www/vicidial_en/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_en/AST_agent_performance.php b/LANG_www/vicidial_en/AST_agent_performance.php
deleted file mode 100644
index eb2ceac4..00000000
--- a/LANG_www/vicidial_en/AST_agent_performance.php
+++ /dev/null
@@ -1,257 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1711 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-# 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars
-#
-
-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 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++;
-	}
-?>
-
-
-
-
-
-\n";
-echo "VICIDIAL: Agent Performance\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 SERVER AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
-echo " NOTE: stats taken from 6 hour shift specified\n";
-}
-
-else
-{
-if ($shift == 'AM') 
-	{
-	$query_date_BEGIN = "$query_date 08:45:00";   
-	$query_date_END = "$query_date 15:33:00";
-	$time_BEGIN = "08:45:00";   
-	$time_END = "15:33:00";
-	}
-if ($shift == 'PM') 
-	{
-	$query_date_BEGIN = "$query_date 15:33:00";   
-	$query_date_END = "$query_date 23:15:00";
-	$time_BEGIN = "15:33:00";   
-	$time_END = "23:15:00";
-	}
-
-echo "VICIDIAL: Agent Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- AGENTS Details -------------\n\n";
-
-echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "| USER NAME       | ID       | CALLS  | TALK   | TALKAVG| A    | B    | DC   | DNC  | N    | NI   | SALE |\n";
-echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-$stmt="select count(*) as calls,sum(length_in_sec) as talk,full_name,vicidial_users.user,avg(length_in_sec) from vicidial_users,vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and vicidial_users.user=vicidial_log.user and campaign_id='" . mysql_real_escape_string($group) . "' group by full_name order by calls desc limit 1000;";
-if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$rows_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $rows_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$TOTcalls=($TOTcalls + $row[0]);
-	$TOTtotTALK=($TOTtotTALK + $row[1]);
-	$calls[$i] =	sprintf("%-6s", $row[0]);
-
-	if ($non_latin < 1)
-	{
-   	 $full_name[$i]=	sprintf("%-15s", $row[2]); 
-	 while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);}
-
-	 $user[$i] =		sprintf("%-6s", $row[3]);
-        while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);}
-       }
-	else
-	{	
-        $full_name[$i]=	sprintf("%-45s", $row[2]); 
-	 while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');}
-
- 	 $user[$i] =		sprintf("%-18s", $row[3]);
-	 while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');}
-	}
-
-	$user[$i] =		sprintf("%-8s", $row[3]);
-	$USERtotTALK =	$row[1];
-	$USERavgTALK =	$row[4];
-
-	$USERtotTALK_M = ($USERtotTALK / 60);
-	$USERtotTALK_M = round($USERtotTALK_M, 2);
-	$USERtotTALK_M_int = intval("$USERtotTALK_M");
-	$USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int);
-	$USERtotTALK_S = ($USERtotTALK_S * 60);
-	$USERtotTALK_S = round($USERtotTALK_S, 0);
-	if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";}
-	$USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S";
-	$pfUSERtotTALK_MS[$i] =		sprintf("%6s", $USERtotTALK_MS);
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$pfUSERavgTALK_MS[$i] =		sprintf("%6s", $USERavgTALK_MS);
-	$i++;
-	}
-
-$k=0;
-while($k < $i)
-	{
-	$ctA[$k]="0   "; $ctB[$k]="0   "; $ctDC[$k]="0   "; $ctDNC[$k]="0   "; $ctN[$k]="0   "; $ctNI[$k]="0   "; $ctSALE[$k]="0   "; 
-	$stmt="select count(*),status from vicidial_log where call_date <= '$query_date_END' and call_date >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;";
-	if ($non_latin > 0)
-	{
-	$rslt=mysql_query("SET NAMES 'UTF8'");
-	}
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$rows_to_print = mysql_num_rows($rslt);
-	$m=0;
-	while ($m < $rows_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-		if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]);		$TOT_A = ($TOT_A + $row[0]);}
-		if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]);		$TOT_B = ($TOT_B + $row[0]);}
-		if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]);	$TOT_DC = ($TOT_DC + $row[0]);}
-		if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]);	$TOT_DNC = ($TOT_DNC + $row[0]);}
-		if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]);		$TOT_N = ($TOT_N + $row[0]);}
-		if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]);	$TOT_NI = ($TOT_NI + $row[0]);}
-		if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]);	$TOT_SALE = ($TOT_SALE + $row[0]);}
-		$m++;
-		}
-	echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctSALE[$k] |\n";
-
-
-
-	$k++;
-	}
-
-	$TOTcalls =	sprintf("%-7s", $TOTcalls);
-
-	$TOTtotTALK_M = ($TOTtotTALK / 60);
-	$TOTtotTALK_M = round($TOTtotTALK_M, 2);
-	$TOTtotTALK_M_int = intval("$TOTtotTALK_M");
-	$TOTtotTALK_S = ($TOTtotTALK_M - $TOTtotTALK_M_int);
-	$TOTtotTALK_S = ($TOTtotTALK_S * 60);
-	$TOTtotTALK_S = round($TOTtotTALK_S, 0);
-	if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";}
-	$TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S";
-	$TOTtotTALK_MS =		sprintf("%7s", $TOTtotTALK_MS);
-		while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);}
-
-	$TOT_A = sprintf("%-5s", $TOT_A);
-	$TOT_B = sprintf("%-5s", $TOT_B);
-	$TOT_DC = sprintf("%-5s", $TOT_DC);
-	$TOT_DNC = sprintf("%-5s", $TOT_DNC);
-	$TOT_N = sprintf("%-5s", $TOT_N);
-	$TOT_NI = sprintf("%-5s", $TOT_NI);
-	$TOT_SALE = sprintf("%-5s", $TOT_SALE);
-
-echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-echo "|  TOTALS                    | $TOTcalls| $TOTtotTALK_MS|        | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_SALE|\n";
-echo "+-----------------+----------+--------+--------+--------+------+------+------+------+------+------+------+\n";
-
-echo "\n";
-
-}
-
-
-
-?>
-
-
\ No newline at end of file
diff --git a/LANG_www/vicidial_en/AST_agent_performance_detail.php b/LANG_www/vicidial_en/AST_agent_performance_detail.php
deleted file mode 100644
index 5557d4dd..00000000
--- a/LANG_www/vicidial_en/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_en/AST_agent_time_sheet.php b/LANG_www/vicidial_en/AST_agent_time_sheet.php
deleted file mode 100644
index bd562a7b..00000000
--- a/LANG_www/vicidial_en/AST_agent_time_sheet.php
+++ /dev/null
@@ -1,286 +0,0 @@
-    LICENSE: GPLv2
-###
-# CHANGES
-#
-# 60619-1729 - 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 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 where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "FIRST LOGIN:          $row[0]\n";
-$start = $row[1];
-
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysql_real_escape_string($query_date_END) . "' and event_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and user='" . mysql_real_escape_string($agent) . "' order by event_time desc limit 1;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-echo "LAST LOG ACTIVITY:    $row[0]\n";
-$end = $row[1];
-
-$login_time = ($end - $start);
-	$LOGIN_TIME_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_en/AST_agent_time_sheet_archive.php b/LANG_www/vicidial_en/AST_agent_time_sheet_archive.php
deleted file mode 100644
index fb71d1d6..00000000
--- a/LANG_www/vicidial_en/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_en/AST_inboundEXTstats.php b/LANG_www/vicidial_en/AST_inboundEXTstats.php
deleted file mode 100644
index 5bc24935..00000000
--- a/LANG_www/vicidial_en/AST_inboundEXTstats.php
+++ /dev/null
@@ -1,400 +0,0 @@
-    LICENSE: GPLv2
-#
-# CHANGES
-# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
-# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat
-#            - Added required user/pass to gain access to this page
-#
-
-require("dbconnect.php");
-
-$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
-$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
-$PHP_SELF=$_SERVER['PHP_SELF'];
-if (isset($_GET["group"]))					{$group=$_GET["group"];}
-	elseif (isset($_POST["group"]))			{$group=$_POST["group"];}
-if (isset($_GET["query_date"]))				{$query_date=$_GET["query_date"];}
-	elseif (isset($_POST["query_date"]))	{$query_date=$_POST["query_date"];}
-if (isset($_GET["server_ip"]))				{$server_ip=$_GET["server_ip"];}
-	elseif (isset($_POST["server_ip"]))		{$server_ip=$_POST["server_ip"];}
-if (isset($_GET["submit"]))					{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
-if (isset($_GET["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($server_ip)) {$server_ip = '10.10.11.20';}
-
-$stmt="select extension,full_number,inbound_name from inbound_numbers where server_ip='" . mysql_real_escape_string($server_ip) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$inbound_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $inbound_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-	$inbound[$i] =$row[0];
-	$fullnum[$i] =$row[1];
-	$inbname[$i] =$row[2];
-	$i++;
-	}
-?>
-
-
-
-
-
-\n";
-#echo"\n";
-echo "ASTERISK: Inbound Calls Stats\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 NUMBER AND DATE ABOVE AND CLICK SUBMIT\n";
-}
-
-else
-{
-
-
-echo "ASTERISK: Inbound Calls Stats                      $NOW_TIME\n";
-
-echo "\n";
-echo "---------- TOTALS\n";
-
-$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
-if (eregi("\*",$group))
-	{$extenSQL = "and extension LIKE \"%$group\"";}
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$average_hold_seconds = ($row[1] / $row[0]);
-$average_hold_seconds = round($average_hold_seconds, 0);
-$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-
-echo "Total Calls That came into this number:       $TOTALcalls\n";
-echo "Average Call Length(seconds) for all Calls:   $average_hold_seconds\n";
-
-echo "\n";
-echo "---------- DROPS\n";
-
-$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-
-$DROPcalls =	sprintf("%10s", $row[0]);
-$DROPpercent = (($DROPcalls / $TOTALcalls) * 100);
-$DROPpercent = round($DROPpercent, 0);
-
-if ($row[0])
-	{
-	$average_hold_seconds = ($row[1] / $row[0]);
-	$average_hold_seconds = round($average_hold_seconds, 0);
-	$average_hold_seconds =	sprintf("%10s", $average_hold_seconds);
-	}
-else {$DROPpercent=0;   $average_hold_seconds=0;}
-echo "Total DROP Calls:   (less than 10 seconds)    $DROPcalls  $DROPpercent%\n";
-echo "Average Call Length(seconds) for DROP Calls:  $average_hold_seconds\n";
-
-
-##############################
-#########  CALLS STATS
-
-echo "\n";
-echo "---------- CALL LISTINGS\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-echo "| CALLERID             | CALLERIDNAME         | LENGTH | DATE TIME           |\n";
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-$stmt="select number_dialed,caller_code,length_in_sec,start_time from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$users_to_print = mysql_num_rows($rslt);
-$i=0;
-while ($i < $users_to_print)
-	{
-	$row=mysql_fetch_row($rslt);
-
-	$CID =			sprintf("%-20s", $row[0]);
-	$CIDname =		sprintf("%-20s", $row[1]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
-	$datetime =		sprintf("%-19s", $row[3]);
-	$USERavgTALK =	$row[2];
-
-	$USERavgTALK_M = ($USERavgTALK / 60);
-	$USERavgTALK_M = round($USERavgTALK_M, 2);
-	$USERavgTALK_M_int = intval("$USERavgTALK_M");
-	$USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int);
-	$USERavgTALK_S = ($USERavgTALK_S * 60);
-	$USERavgTALK_S = round($USERavgTALK_S, 0);
-	if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";}
-	$USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S";
-	$USERavgTALK_MS =		sprintf("%6s", $USERavgTALK_MS);
-
-	echo "| $CID | $CIDname | $USERavgTALK_MS | $datetime |\n";
-
-	$i++;
-	}
-
-echo "+----------------------+----------------------+--------+---------------------+\n";
-
-##############################
-#########  TIME STATS
-
-if ($output == 'FULL')
-	{
-
-	echo "\n";
-	echo "---------- TIME STATS\n";
-
-	echo "\n";
-
-	$hi_hour_count=0;
-	$last_full_record=0;
-	$i=0;
-	$h=0;
-	while ($i <= 96)
-		{
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:00:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:14:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:15:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:29:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:30:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:44:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$hour_count[$i] = $row[0];
-		if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
-		if ($hour_count[$i] > 0) {$last_full_record = $i;}
-		$stmt="select count(*) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " $h:45:00' and start_time <= '" . mysql_real_escape_string($query_date) . " $h:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL and (length_in_sec <= 10 or length_in_sec is null);";
-		$rslt=mysql_query($stmt, $link);
-		if ($DB) {echo "$stmt\n";}
-		$row=mysql_fetch_row($rslt);
-		$drop_count[$i] = $row[0];
-		$i++;
-		$h++;
-		}
-
-	$hour_multiplier = (100 / $hi_hour_count);
-	#$hour_multiplier = round($hour_multiplier, 0);
-
-	echo "\n";
-	echo "GRAPH IN 15 MINUTE INCREMENTS OF TOTAL CALLS\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_en/AST_inboundEXTstats_department.php b/LANG_www/vicidial_en/AST_inboundEXTstats_department.php deleted file mode 100644 index 015f6820..00000000 --- a/LANG_www/vicidial_en/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_en/AST_server_performance.php b/LANG_www/vicidial_en/AST_server_performance.php deleted file mode 100644 index afa75bd3..00000000 --- a/LANG_www/vicidial_en/AST_server_performance.php +++ /dev/null @@ -1,306 +0,0 @@ - LICENSE: GPLv2 -# -# CHANGES -# -# 60619-1732 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 70417-1106 - Changed time frame to be definable per time range on a single day -# - Fixed vertical scaling issues -# - -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"];} - elseif (isset($_POST["end_query_time"])) {$end_query_time=$_POST["end_query_time"];} -if (isset($_GET["group"])) {$group=$_GET["group"];} - elseif (isset($_POST["group"])) {$group=$_POST["group"];} -if (isset($_GET["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' and modify_servers='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -# path from root to where ploticus files will be stored -$PLOTroot = "vicidial/ploticus"; -$DOCroot = "$WeBServeRRooT/$PLOTroot/"; - -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -if (!isset($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($group)) {$group = '';} - -$stmt="select server_ip 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); - $groups[$i] =$row[0]; - $i++; - } -?> - - - - - -\n"; -echo "VICIDIAL: Server Performance\n"; -echo "
\n"; -echo "Date:   \n"; -echo "Time: \n"; -echo "to \n"; -echo "Server: \n"; -echo "\n"; -echo "             REPORTS \n"; -echo "
\n\n"; - -echo "
\n";
-
-
-if (!$group)
-{
-echo "\n";
-echo "PLEASE SELECT A SERVER, DATE AND TIME RANGE ABOVE AND CLICK SUBMIT\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";
-
-echo "VICIDIAL: Server Performance                             $NOW_TIME\n";
-
-echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
-echo "---------- TOTALS, PEAKS and AVERAGES\n";
-
-$stmt="select AVG(sysload),AVG(channels_total),MAX(sysload),MAX(channels_total),MAX(processes) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGload =	sprintf("%10s", $row[0]);
-$AVGchannels =	sprintf("%10s", $row[1]);
-$HIGHload =	$row[2];
-	$HIGHmulti = intval($HIGHload / 100);
-$HIGHchannels =	$row[3];
-$HIGHprocesses =$row[4];
-if ($row[2] > $row[3]) {$HIGHlimit = $row[2];}
-else {$HIGHlimit = $row[3];}
-if ($HIGHlimit < $row[4]) {$HIGHlimit = $row[4];}
-
-$stmt="select AVG(cpu_user_percent),AVG(cpu_system_percent),AVG(cpu_idle_percent) from server_performance where start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$AVGcpuUSER =	sprintf("%10s", $row[0]);
-$AVGcpuSYSTEM =	sprintf("%10s", $row[1]);
-$AVGcpuIDLE =	sprintf("%10s", $row[2]);
-
-$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and  start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$row=mysql_fetch_row($rslt);
-$TOTALcalls =	sprintf("%10s", $row[0]);
-$OFFHOOKtime =	sprintf("%10s", $row[1]);
-
-
-echo "Total Calls in/out on this server:        $TOTALcalls\n";
-echo "Total Off-Hook time on this server (min): $OFFHOOKtime\n";
-echo "Average/Peak channels in use for server:  $AVGchannels / $HIGHchannels\n";
-echo "Average/Peak load for server:             $AVGload / $HIGHload\n";
-echo "Average USER process cpu percentage:      $AVGcpuUSER %\n";
-echo "Average SYSTEM process cpu percentage:    $AVGcpuSYSTEM %\n";
-echo "Average IDLE process cpu percentage:      $AVGcpuIDLE %\n";
-
-echo "\n";
-echo "---------- LINE GRAPH:\n";
-
-
-
-##############################
-#########  Graph stats
-
-$DAT = '.dat';
-$HTM = '.htm';
-$PNG = '.png';
-$filedate = date("Y-m-d_His");
-$DATfile = "$group$query_date$shift$filedate$DAT";
-$HTMfile = "$group$query_date$shift$filedate$HTM";
-$PNGfile = "$group$query_date$shift$filedate$PNG";
-
-$HTMfp = fopen ("$DOCroot/$HTMfile", "a");
-$DATfp = fopen ("$DOCroot/$DATfile", "a");
-
-$stmt="select DATE_FORMAT(start_time,'%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;";
-$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[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");
-	$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 > 2000) {$time_scale_abb = '20 minutes';   $time_scale_tick = '4 minutes';}
-if ($i > 3000) {$time_scale_abb = '30 minutes';   $time_scale_tick = '5 minutes';}
-if ($i > 4000) {$time_scale_abb = '40 minutes';   $time_scale_tick = '10 minutes';}
-if ($i > 5000) {$time_scale_abb = '60 minutes';   $time_scale_tick = '15 minutes';}
-if ($i > 6000) {$time_scale_abb = '90 minutes';   $time_scale_tick = '15 minutes';}
-if ($i > 7000) {$time_scale_abb = '120 minutes';   $time_scale_tick = '30 minutes';}
-
-$HTMcontent  = '';
-$HTMcontent .= "#proc page\n";
-$HTMcontent .= "#if @DEVICE in png,gif\n";
-$HTMcontent .= "   scale: 0.6\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#endif\n";
-$HTMcontent .= "#proc getdata\n";
-$HTMcontent .= "file: $DOCroot/$DATfile\n";
-$HTMcontent .= "fieldnames: userproc sysproc time 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 .= "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 .= "\n";
-$HTMcontent .= "#proc yaxis\n";
-$HTMcontent .= "stubs: inc 50\n";
-$HTMcontent .= "grid: color=yellow\n";
-$HTMcontent .= "gridskip: min\n";
-$HTMcontent .= "ticincrement: 100 1000\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: userproc\n";
-$HTMcontent .= "linedetails: color=purple width=.5\n";
-$HTMcontent .= "fill: lavender\n";
-$HTMcontent .= "legendlabel: user proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc lineplot\n";
-$HTMcontent .= "xfield: time\n";
-$HTMcontent .= "yfield: sysproc\n";
-$HTMcontent .= "linedetails: color=yelloworange width=.5\n";
-$HTMcontent .= "fill: dullyellow\n";
-$HTMcontent .= "legendlabel: system proc%\n";
-$HTMcontent .= "maxinpoints: $rows_to_max\n";
-$HTMcontent .= "\n";
-$HTMcontent .= "#proc curvefit\n";
-$HTMcontent .= "xfield: time\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 .= "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 .= "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 .= "seglen: 0.2\n";
-$HTMcontent .= "\n";
-
-fwrite ($HTMfp, "$HTMcontent");
-fclose($HTMfp);
-
-
-passthru("/usr/local/bin/pl -png $DOCroot/$HTMfile -o $DOCroot/$PNGfile");
-
-sleep(1);
-
-echo "
\n"; -echo "\n"; -echo "\n"; - - -echo ""; - -} - - - -?> - - \ No newline at end of file diff --git a/LANG_www/vicidial_en/AST_timeonVDAD.php b/LANG_www/vicidial_en/AST_timeonVDAD.php deleted file mode 100644 index e9c8f52e..00000000 --- a/LANG_www/vicidial_en/AST_timeonVDAD.php +++ /dev/null @@ -1,374 +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 -# 61114-2004 - Changed to display CLOSER and DEFAULT, added trunk shortage -# - -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"];} -if (isset($_GET["closer_display"])) {$closer_display=$_GET["closer_display"];} - elseif (isset($_POST["closer_display"])) {$closer_display=$_POST["closer_display"];} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "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 "
";
-
-###################################################################################
-###### SERVER INFORMATION
-###################################################################################
-
-$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where server_ip='" . mysql_real_escape_string($server_ip) . "';";
-$rslt=mysql_query($stmt, $link);
-$row=mysql_fetch_row($rslt);
-$balanceSHORT = $row[0];
-
-echo "SERVER: $server_ip\n";
-
-
-
-###################################################################################
-###### TIME ON SYSTEM
-###################################################################################
-
-if ($closer_display>0) {$closer_display_reverse=0;   $closer_reverse_link='DEFAULT';}
-else {$closer_display_reverse=1;   $closer_reverse_link='CLOSER';}
-
-echo "VICIDIAL: Agents Time On Calls           $NOW_TIME    $closer_reverse_link | REPORTS\n\n";
-
-if ($closer_display>0)
-{
-echo "+------------|--------+-----------+---------------------+--------+----------+---------+--------------+--------+\n";
-echo "| STATION    | 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";
-}
-
-$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]);
-
-		if ($closer_display<1)
-			{
-			$G = '';		$EG = '';
-			if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-			if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-			if (eregi("PAUSED",$row[4])) 
-				{
-				if ($call_time_M_int >= 1) 
-					{$i++; continue;} 
-				else
-					{$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";
-			}
-		$i++;
-		}
-
-		if ($closer_display>0)
-		{
-
-			$ext_count = $i;
-			$i=0;
-		while ($i < $ext_count)
-			{
-
-			$stmt="select campaign_id from vicidial_auto_calls where lead_id='$lead_id[$i]' and server_ip='" . mysql_real_escape_string($server_ip) . "';";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$camp_to_print = mysql_num_rows($rslt);
-			if ($camp_to_print > 0)
-				{
-				$row=mysql_fetch_row($rslt);
-				$campaign = sprintf("%-12s", $row[0]);
-				$camp_color = $row[0];
-				}
-			else
-				{$campaign = 'DEAD        ';   	$camp_color = 'DEAD';}
-			if (eregi("READY|PAUSED|CLOSER",$status[$i]))
-				{$campaign = '            ';   	$camp_color = '';}
-
-			$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
-			$rslt=mysql_query($stmt, $link);
-			if ($DB) {echo "$stmt\n";}
-			$xfer_to_print = mysql_num_rows($rslt);
-			if ($xfer_to_print > 0)
-				{
-				$row=mysql_fetch_row($rslt);
-				$fronter = sprintf("%-6s", $row[0]);
-				}
-			else
-				{$fronter = '      ';}
-
-			$G = '';		$EG = '';
-			$G=""; $EG='';
-		#	if ($call_time_M_int[$i] >= 5) {$G=''; $EG='';}
-		#	if ($call_time_M_int[$i] >= 10) {$G=''; $EG='';}
-
-			echo "| $G$extension[$i]$EG | $G$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 "  $agentcount agents logged in on server $server_ip\n\n";
-
-		echo "             - Paused agents\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            TRUNK SHORT: $balanceSHORT              $NOW_TIME\n\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-echo "| CHANNEL             | STATUS | CAMPAIGN     | PHONE NUMBER       | CALLTIME | MINUTES |\n";
-echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-
-$stmt="select channel,status,campaign_id,phone_code,phone_number,call_time,UNIX_TIMESTAMP(call_time) from vicidial_auto_calls where status NOT IN('XFER') and server_ip='" . mysql_real_escape_string($server_ip) . "' order by auto_call_id desc;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-19s", $row[0]);
-			$cc=0;
-		while ( (strlen($channel) > 19) and ($cc < 100) )
-			{
-			$channel = eregi_replace(".$","",$channel);   
-			$cc++;
-			if (strlen($channel) <= 19) {$cc=101;}
-			}
-		$start_time =		sprintf("%-8s", $row[5]);
-			$cd=0;
-		while ( (strlen($start_time) > 8) and ($cd < 100) )
-			{
-			$start_time = eregi_replace("^.","",$start_time);   
-			$cd++;
-			if (strlen($start_time) <= 8) {$cd=101;}
-			}
-		$status =			sprintf("%-6s", $row[1]);
-		$campaign =			sprintf("%-12s", $row[2]);
-			$all_phone = "$row[3]$row[4]";
-		$number_dialed =	sprintf("%-18s", $all_phone);
-		$call_time_S = ($STARTtime - $row[6]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if (eregi("LIVE",$status)) {$G=''; $EG='';}
-	#	if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+---------------------+--------+--------------+--------------------+----------+---------+\n";
-		echo "  $i 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_en/AST_timeonVDAD_closer.php b/LANG_www/vicidial_en/AST_timeonVDAD_closer.php deleted file mode 100644 index 23eb851e..00000000 --- a/LANG_www/vicidial_en/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_en/AST_timeonVDADall.php b/LANG_www/vicidial_en/AST_timeonVDADall.php deleted file mode 100644 index ec8eb52a..00000000 --- a/LANG_www/vicidial_en/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_en/AST_timeonVDADallREC.php b/LANG_www/vicidial_en/AST_timeonVDADallREC.php deleted file mode 100644 index 2abf27b2..00000000 --- a/LANG_www/vicidial_en/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_en/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_en/AST_timeonVDADallSUMMARY.php deleted file mode 100644 index 242b27a0..00000000 --- a/LANG_www/vicidial_en/AST_timeonVDADallSUMMARY.php +++ /dev/null @@ -1,442 +0,0 @@ - LICENSE: GPLv2 -# -# Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers -# -# STOP=4000, SLOW=40, GO=4 seconds refresh interval -# -# changes: -# 61102-1616 - first build -# 61215-1131 - added answered calls and drop percent taken from answered calls -# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns -# 70619-1339 - Added Status Category tally display -# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction -# - -header ("Content-type: text/html; charset=utf-8"); - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["RR"])) {$RR=$_GET["RR"];} - elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} - elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($RR)) {$gRRroup=4;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - -$NOW_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); - -$stmt="select campaign_id from vicidial_campaigns where active='Y';"; -$rslt=mysql_query($stmt, $link); -if (!isset($DB)) {$DB=0;} -if ($DB) {echo "$stmt\n";} -$groups_to_print = mysql_num_rows($rslt); -$i=0; -while ($i < $groups_to_print) - { - $row=mysql_fetch_row($rslt); - $groups[$i] =$row[0]; - $i++; - } - -if (!isset($RR)) {$RR=4;} - -?> - - - - - -\n"; -echo "VICIDIAL: Realtime All Campaigns Summary\n"; -echo "VICIDIAL: Realtime All Campaigns Summary           \n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO "; -echo "       \n"; -if ($adastats<2) - { - echo "+ VIEW MORE SETTINGS"; - } -else - { - echo "- VIEW LESS SETTINGS"; - } -echo "       REPORTS"; -echo "

\n\n"; - -$k=0; -while($k<$groups_to_print) -{ -$NFB = ''; -$NFE = ''; -$F=''; $FG=''; $B=''; $BG=''; - -$group = $groups[$k]; -echo "$group   -   "; -echo "Modify\n"; - - -$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; -$rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $campaign_allow_inbound = $row[0]; - -$stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DIALlev = $row[0]; -$DIALstatusA = $row[1]; -$DIALstatusB = $row[2]; -$DIALstatusC = $row[3]; -$DIALstatusD = $row[4]; -$DIALstatusE = $row[5]; -$DIALorder = $row[6]; -$DIALfilter = $row[7]; -$HOPlev = $row[8]; -$DIALmethod = $row[9]; -$maxDIALlev = $row[10]; -$DROPmax = $row[11]; -$targetDIFF = $row[12]; -$ADAintense = $row[13]; -$ADAavailonly = $row[14]; -$TAPERtime = $row[15]; -$CALLtime = $row[16]; -$DIALtimeout = $row[17]; -$DIALstatuses = $row[18]; - $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); - $DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); - -$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$VDhop = $row[0]; - -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; -$agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; -$answersTODAY = $row[7]; -$VSCcat1 = $row[8]; -$VSCcat1tally = $row[9]; -$VSCcat2 = $row[10]; -$VSCcat2tally = $row[11]; -$VSCcat3 = $row[12]; -$VSCcat3tally = $row[13]; -$VSCcat4 = $row[14]; -$VSCcat4tally = $row[15]; - -if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) - { - $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); - $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); - } -else {$diffpctONEMIN = '0.00';} - -$stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$balanceSHORT = $row[0]; - -echo "
"; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -if ($adastats>1) - { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo "
DIAL LEVEL:  $DIALlev    TRUNK SHORT/FILL:  $balanceSHORT / $balanceFILL     FILTER:  $DIALfilter   TIME:   $NOW_TIME
  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 "
"; - -### Header finish - - - - - -################################################################################ -### START calculating calls/agents -################################################################################ - -################################################################################ -###### OUTBOUND CALLS -################################################################################ -if ($campaign_allow_inbound > 0) - { - $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysql_real_escape_string($group) . "' and call_type='OUT') );"; - } -else - { - if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} - else {$groupSQL = " and campaign_id='" . mysql_real_escape_string($group) . "'";} - - $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; - } -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$parked_to_print = mysql_num_rows($rslt); - if ($parked_to_print > 0) - { - $i=0; - $out_total=0; - $out_ring=0; - $out_live=0; - 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; - -$stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysql_real_escape_string($group) . "';"; -$rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - $agentcount=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[3])) - { - $row[5]=$row[6]; - } - $Lstatus = $row[3]; - $status = sprintf("%-6s", $row[3]); - if (!eregi("INCALL|QUEUE",$row[3])) - {$call_time_S = ($STARTtime - $row[6]);} - else - {$call_time_S = ($STARTtime - $row[5]);} - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if (eregi("PAUSED",$row[3])) - { - if ($call_time_M_int >= 30) - {$i++; continue;} - else - { - $agent_paused++; $agent_total++; - } - } - - if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} - if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} - $agentcount++; - - - $i++; - } - - if ($agent_ready > 0) {$B=''; $BG='';} - if ($agent_ready > 4) {$B=''; $BG='';} - if ($agent_ready > 9) {$B=''; $BG='';} - if ($agent_ready > 14) {$B=''; $BG='';} - - echo "\n
\n"; - - echo "$NFB$agent_total$NFE agents logged in         \n"; - echo "$NFB$agent_incall$NFE agents in calls       \n"; - echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; - echo "$NFB$agent_paused$NFE paused agents       \n"; - - echo "
";
-		echo "";
-	}
-	else
-	{
-	echo " NO AGENTS ON CALLS
\n"; - } - -################################################################################ -### END calculating calls/agents -################################################################################ - - - - - -echo "
"; - -echo "\n\n"; -$k++; -} - -?> -
- - diff --git a/LANG_www/vicidial_en/AST_timeoncall.php b/LANG_www/vicidial_en/AST_timeoncall.php deleted file mode 100644 index 4227f836..00000000 --- a/LANG_www/vicidial_en/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_en/AST_timeonpark.php b/LANG_www/vicidial_en/AST_timeonpark.php deleted file mode 100644 index fd54a333..00000000 --- a/LANG_www/vicidial_en/AST_timeonpark.php +++ /dev/null @@ -1,219 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1042 - 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["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 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_TIME = date("Y-m-d H:i:s"); -$STARTtime = date("U"); -$timeONEhoursAGO = ($STARTtime - 3600); -$epochHALFhoursAGO = ($STARTtime - 1860); -$timeONEhoursAGO = date("Y-m-d H:i:s",$timeONEhoursAGO); -$timeHALFhoursAGO = date("Y-m-d H:i:s",$epochHALFhoursAGO); - -$reset_counter++; - -if ($reset_counter > 7) - { - $reset_counter=0; - - $stmt="update park_log set status='HUNGUP' where hangup_time is not null;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - - if ($DB) - { - $stmt="delete from park_log where status='TALKING' and grab_time < '$timeONEhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - $stmt="delete from park_log where status='PARKED' and parked_time < '$timeHALFhoursAGO' and (hangup_time is null or hangup_time='');"; - $rslt=mysql_query($stmt, $link); - echo "$stmt\n"; - - } - } - -?> - - - - - -\n"; -echo"\n"; -echo "VICIDIAL: Time On Park\n"; -echo "
\n\n";
-
-echo "VICIDIAL: Time On Park         $NOW_TIME    REPORTS\n\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-echo "| CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------+-----------------+---------------------+---------+\n";
-
-#$link=mysql_connect("localhost", "cron", "1234");
-# $linkX=mysql_connect("localhost", "cron", "1234");
-#mysql_select_db("asterisk");
-
-$stmt="select extension,user,channel,channel_group,parked_time,UNIX_TIMESTAMP(parked_time) from park_log where status ='PARKED' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$parked_to_print = mysql_num_rows($rslt);
-	if ($parked_to_print > 0)
-	{
-	$i=0;
-	while ($i < $parked_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 1) {$G=''; $EG='';}
-		if ($call_time_M_int >= 6) {$G=''; $EG='';}
-
-		echo "| $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------+-----------------+---------------------+---------+\n";
-		echo "  $i callers waiting on server $server_ip\n\n";
-
-		echo "             - 1 minute or more on hold\n";
-		echo "             - Over 5 minutes on hold\n";
-
-		}
-	else
-	{
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	echo "******************** NO LIVE CALLS WAITING *********************\n";
-	echo "****************************************************************\n";
-	echo "****************************************************************\n";
-	}
-
-###################################################################################
-###### TIME ON INBOUND CALLS
-###################################################################################
-echo "\n\n";
-echo "----------------------------------------------------------------------------------------";
-echo "\n\n";
-echo "VICIDIAL: Agents Time On Inbound Calls                             $NOW_TIME\n\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-echo "| STATION    | USER   | CHANNEL    | GROUP           | START TIME          | MINUTES |\n";
-echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-
-
-$stmt="select extension,user,channel,channel_group,grab_time,UNIX_TIMESTAMP(grab_time) from park_log where status ='TALKING' and server_ip='" . mysql_real_escape_string($server_ip) . "' order by uniqueid;";
-$rslt=mysql_query($stmt, $link);
-if ($DB) {echo "$stmt\n";}
-$talking_to_print = mysql_num_rows($rslt);
-	if ($talking_to_print > 0)
-	{
-	$i=0;
-	while ($i < $talking_to_print)
-		{
-		$row=mysql_fetch_row($rslt);
-
-		$extension =		sprintf("%-10s", $row[0]);
-		$user =				sprintf("%-6s", $row[1]);
-		$channel =			sprintf("%-10s", $row[2]);
-		$number_dialed =	sprintf("%-15s", $row[3]);
-		$start_time =		sprintf("%-19s", $row[4]);
-		$call_time_S = ($STARTtime - $row[5]);
-
-		$call_time_M = ($call_time_S / 60);
-		$call_time_M = round($call_time_M, 2);
-		$call_time_M_int = intval("$call_time_M");
-		$call_time_SEC = ($call_time_M - $call_time_M_int);
-		$call_time_SEC = ($call_time_SEC * 60);
-		$call_time_SEC = round($call_time_SEC, 0);
-		if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";}
-		$call_time_MS = "$call_time_M_int:$call_time_SEC";
-		$call_time_MS =		sprintf("%7s", $call_time_MS);
-		$G = '';		$EG = '';
-		if ($call_time_M_int >= 12) {$G=''; $EG='';}
-		if ($call_time_M_int >= 31) {$G=''; $EG='';}
-
-		echo "| $G$extension$EG | $G$user$EG | $G$channel$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
-
-		$i++;
-		}
-
-		echo "+------------|--------+------------+-----------------+---------------------+---------+\n";
-		echo "  $i agents on calls on server $server_ip\n\n";
-
-		echo "             - 12 minutes or more on call\n";
-		echo "             - Over 30 minutes on call\n";
-
-	}
-	else
-	{
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	echo "********************************* NO AGENTS ON CALLS *********************************\n";
-	echo "**************************************************************************************\n";
-	echo "**************************************************************************************\n";
-	}
-
-
-?>
-
- - \ No newline at end of file diff --git a/LANG_www/vicidial_en/admin.php b/LANG_www/vicidial_en/admin.php index 7fc0228a..c29afe44 100644 --- a/LANG_www/vicidial_en/admin.php +++ b/LANG_www/vicidial_en/admin.php @@ -1,13575 +1,29 @@ 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");} - +$CL=':'; +$AT='@'; +$DS='-'; $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"; +$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_en/admin.php','vicidial',$agcPAGE); + +header("Location: $agcDIR/admin.php"); +echo"\n"; +echo"\n"; +echo"\n"; +echo"\n"; +echo"\n"; +echo"click here to continue. . .\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 "\r\n"; - print " \r\n"; - } - $rec_count++; - } -$sthA->finish(); - -exit; diff --git a/LANG_www/vicidial_en/listloader_super.pl b/LANG_www/vicidial_en/listloader_super.pl deleted file mode 100644 index 167fff5e..00000000 --- a/LANG_www/vicidial_en/listloader_super.pl +++ /dev/null @@ -1,1086 +0,0 @@ -#!/usr/bin/perl - -### listloader_super.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 -### -# -# -# CHANGES -# 60616-1548 - Added listID override feature to force all leads into same list -# - Added gmt_offset_now lookup for each lead -# 60811-1232 - Changed to DBI -# 60811-1329 - changed to use /etc/astguiclient.conf for configs -# 60906-1056 - added filter of non-digits in alt_phone field -# 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme -# 61128-1207 - added postal code GMT lookup and duplicate check options -# 70205-1703 - Defaulted phone_code to 1 if not populated -# 70417-1059 - Fixed default phone_code bug -# 70510-1518 - Added campaign and system duplicate check and phonecode override -# - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - - exit; - } - else - { - if ($args =~ /-duplicate-check/i) - {$dupcheck=1;} - if ($args =~ /-duplicate-campaign-check/i) - {$dupcheckcamp=1;} - if ($args =~ /-duplicate-system-check/i) - {$dupchecksys=1;} - if ($args =~ /-postal-code-gmt/i) - {$postalgmt=1;} - if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); - $forcelistid = $data_in[1]; - $forcelistid =~ s/ .*//gi; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } - else - {$forcelistid = '';} - - if ($args =~ /--forcephonecode=/i) - { - @data_in = split(/--forcephonecode=/,$args); - $forcephonecode = $data_in[1]; - $forcephonecode =~ s/ .*//gi; - print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; - } - else - {$forcephonecode = '';} - - if ($args =~ /--lead-file=/i) - { - @data_in = split(/--lead-file=/,$args); - $lead_file = $data_in[1]; - $lead_file =~ s/ .*//gi; - # print "\n----- LEAD FILE: $lead_file -----\n\n"; - } - else - {$lead_file = './vicidial_temp_file.xls';} - } -} -### end parsing run-time options ### - -use Spreadsheet::ParseExcel; -use Time::Local; -use DBI; - - -# default path to astguiclient configuration file: -$PATHconf = '/etc/astguiclient.conf'; - -open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; -@conf = ; -close(conf); -$i=0; -foreach(@conf) - { - $line = $conf[$i]; - $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; - if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) - {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} - if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) - {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} - if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) - {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} - if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) - {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} - if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) - {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} - if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) - {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} - if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) - {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) - {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) - {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) - {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) - {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) - {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} - $i++; - } - -# Customized Variables -$server_ip = $VARserver_ip; # Asterisk server IP - -if (!$VARDB_port) {$VARDB_port='3306';} - -$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") - or die "Couldn't connect to database: " . DBI->errstr; - - -$vars=$ARGV[0]; -@xls_fields=split(/\,/, $vars); - -$|=0; -$secX = time(); - -($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -$year = ($year + 1900); -$mon++; -if ($hour < 10) {$hour = "0$hour";} -if ($min < 10) {$min = "0$min";} -if ($sec < 10) {$sec = "0$sec";} -if ($mon < 10) {$mon = "0$mon";} -if ($mday < 10) {$mday = "0$mday";} -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$pulldate="$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - - ### Grab Server values from the database - $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $DBSERVER_GMT = "$aryA[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - $rec_count++; - } - $sthA->finish(); - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -if ($isdst) {$LOCAL_GMT_OFF++;} -if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - - -$total=0; $good=0; $bad=0; -open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); -my($iR, $iC, $oWkS, $oWkC); - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { - - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[0]]; - if ($oWkC) {$vendor_lead_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[1]]; - if ($oWkC) {$source_code=$oWkC->Value; } - $source_id=$source_code; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[2]]; - if ($oWkC) {$list_id=$oWkC->Value; } - $gmt_offset = '0'; - $called_since_last_reset='N'; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[3]]; - if ($oWkC) {$phone_code=$oWkC->Value; } - $phone_code=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[4]]; - if ($oWkC) {$phone_number=$oWkC->Value; } - $phone_number=~s/[^0-9]//g; - $USarea = substr($phone_number, 0, 3); - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[5]]; - if ($oWkC) {$title=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[6]]; - if ($oWkC) {$first_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[7]]; - if ($oWkC) {$middle_initial=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[8]]; - if ($oWkC) {$last_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[9]]; - if ($oWkC) {$address1=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[10]]; - if ($oWkC) {$address2=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[11]]; - if ($oWkC) {$address3=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[12]]; - if ($oWkC) {$city=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[13]]; - if ($oWkC) {$state=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[14]]; - if ($oWkC) {$province=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[15]]; - if ($oWkC) {$postal_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[16]]; - if ($oWkC) {$country_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[17]]; - if ($oWkC) {$gender=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[18]]; - if ($oWkC) {$date_of_birth=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[19]]; - if ($oWkC) {$alt_phone=$oWkC->Value; } - $alt_phone=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[20]]; - if ($oWkC) {$email=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[21]]; - if ($oWkC) {$security_phrase=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][$xls_fields[22]]; - if ($oWkC) {$comments=$oWkC->Value; } - $comments=~s/^\s*(.*?)\s*$/$1/; - - - - if (length($forcelistid) > 0) - { - $list_id = $forcelistid; # set list_id to override value - } - if (length($forcephonecode) > 0) - { - $phone_code = $forcephonecode; # set phone_code to override value - } - - ##### Check for duplicate phone numbers in vicidial_list table entire database ##### - if ($dupchecksys > 0) - { - $dup_lead=0; - $stmtA = "select count(*) from vicidial_list where phone_number='$phone_number';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $dup_lead = $aryA[0]; - $dup_lead_list=$list_id; - } - $sthA->finish(); - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### - if ($dupcheck > 0) - { - $dup_lead=0; - $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id='$list_id' limit 1;"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $dup_lead_list = $aryA[0]; - $dup_lead++; - } - $sthA->finish(); - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### - if ($dupcheckcamp > 0) - { - $dup_lead=0; - $dup_lists=''; - - $stmtA = "select count(*) from vicidial_lists where list_id='$list_id';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - @aryA = $sthA->fetchrow_array; - $ci_recs = $aryA[0]; - $sthA->finish(); - if ($ci_recs > 0) - { - $stmtA = "select campaign_id from vicidial_lists where list_id='$list_id';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - @aryA = $sthA->fetchrow_array; - $dup_camp = $aryA[0]; - $sthA->finish(); - - $stmtA = "select list_id from vicidial_lists where campaign_id='$dup_camp';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $dup_lists .= "'$aryA[0]',"; - $rec_count++; - } - $sthA->finish(); - - chop($dup_lists); - $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $dup_lead_list = "'$aryA[0]',"; - $rec_count++; - $dup_lead=1; - } - $sthA->finish(); - } - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - - if ( (length($phone_number)>6) && ($dup_lead < 1) ) - { - $phone_list .= "$phone_number$US$list_id|"; - $postalgmt_found=0; - if (length($phone_code)<1) {$phone_code = '1';} - - if ( ($postalgmt > 0) && (length($postal_code)>4) ) - { - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[2]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[3]; - $dst_range = $aryA[4]; - $PC_processed++; - $rec_count++; - $postalgmt_found++; - if ($DBX) {print " Postal GMT record found for $postal_code: |$gmt_offset|$dst|$dst_range|\n";} - } - $sthA->finish(); - } - } - if ($postalgmt_found < 1) - { - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### MEXICO ### - if ($phone_code =~ /^52$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### AUSTRALIA ### - if ($phone_code =~ /^61$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); - $year = ($year + 1900); - $mon++; - if ($mon < 10) {$mon = "0$mon";} - if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$hour = "0$hour";} - if ($min < 10) {$min = "0$min";} - if ($sec < 10) {$sec = "0$sec";} - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - - if ( (!$AC_processed) && ($dst_range =~ /SSM-FSN/) ) - { - if ($DBX) {print " Second Sunday March to First Sunday November\n";} - &USACAN_dstcalc; - if ($DBX) {print " DST: $USACAN_DST\n";} - if ($USACAN_DST) {$area_GMT++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - &NA_dstcalc; - if ($DBX) {print " DST: $NA_DST\n";} - if ($NA_DST) {$area_GMT++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - &GBR_dstcalc; - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - &AUS_dstcalc; - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - &AUST_dstcalc; - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - &NZL_dstcalc; - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /TSO-LSF/) ) - { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} - &BZL_dstcalc; - if ($DBX) {print " DST: $BZL_DST\n";} - if ($BZL_DST) {$area_GMT++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; - $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),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - sleep(1); -# flush(); - } - } -} - -if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $affected_rows = $dbhA->do($stmtZ); - print STMT_FILE $stmtZ."\r\n"; -} - -print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total"; - -exit; - - - - - - -sub USACAN_dstcalc { -#********************************************************************** -# SSM-FSN -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on Second Sunday March to First Sunday November at 2 am. -# INPUTS: -# mm INTEGER Month. -# dd INTEGER Day of the month. -# ns INTEGER Seconds into the day. -# dow INTEGER Day of week (0=Sunday, to 6=Saturday) -# OPTIONAL INPUT: -# timezone INTEGER hour difference UTC - local standard time -# (DEFAULT is blank) -# make calculations based on UTC time, -# which means shift at 10:00 UTC in April -# and 9:00 UTC in October -# OUTPUT: -# INTEGER 1 = DST, 0 = not DST -# -# S M T W T F S -# 1 2 3 4 5 6 7 -# 8 9 10 11 12 13 14 -#15 16 17 18 19 20 21 -#22 23 24 25 26 27 28 -#29 30 31 -# -# S M T W T F S -# 1 2 3 4 5 6 -# 7 8 9 10 11 12 13 -#14 15 16 17 18 19 20 -#21 22 23 24 25 26 27 -#28 29 30 31 -# -#********************************************************************** - - $USACAN_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 11) { - $USACAN_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 10) { - $USACAN_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd > 13) { - $USACAN_DST=1; return 1; - } elsif ($dd >= ($dow+8)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $USACAN_DST=0; return 0; - } else { - $USACAN_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $USACAN_DST=0; return 0; - } else { - $USACAN_DST=1; return 1; - } - } - } else { - $USACAN_DST=0; return 0; - } - } elsif ($mm == 11) { - if ($dd > 7) { - $USACAN_DST=0; return 0; - } elsif ($dd < ($dow+1)) { - $USACAN_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USACAN_DST=1; return 1; - } else { - $USACAN_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $USACAN_DST=1; return 1; - } else { - $USACAN_DST=0; return 0; - } - } - } else { - $USACAN_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub NA_dstcalc { -#********************************************************************** -# FSA-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in April and last Sunday in October at 2 am. -#********************************************************************** - - $NA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $NA_DST=0; return 0; - } elsif ($mm >= 5 && $mm <= 9) { - $NA_DST=1; return 1; - } elsif ($mm == 4) { - if ($dd > 7) { - $NA_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NA_DST=0; return 0; - } else { - $NA_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $NA_DST=0; return 0; - } else { - $NA_DST=1; return 1; - } - } - } else { - $NA_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $NA_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $NA_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $NA_DST=1; return 1; - } else { - $NA_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $NA_DST=1; return 1; - } else { - $NA_DST=0; return 0; - } - } - } else { - $NA_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub GBR_dstcalc { -#********************************************************************** -# LSM-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in March and last Sunday in October at 1 am. -#********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 9) { - $GBR_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $GBR_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } - } else { - $GBR_DST=1; return 1; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $GBR_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } - } else { - $GBR_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub AUS_dstcalc { -#********************************************************************** -# LSO-LSM -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUS_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUS_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } - } else { - $AUS_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $AUS_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } - } else { - $AUS_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub AUST_dstcalc { -#********************************************************************** -# FSO-LSM -# TASMANIA ONLY -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUST_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUST_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } - } else { - $AUST_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd >= 8) { - $AUST_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } - } else { - $AUST_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub NZL_dstcalc { -#********************************************************************** -# FSO-TSM -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and third Sunday in March at 1 am. -#********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $NZL_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; return 1; - } elsif ($dd < ($dow+14)) { - $NZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } - } else { - $NZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd >= 8) { - $NZL_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } - } else { - $NZL_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub BZL_dstcalc { -#********************************************************************** -# TSO-LSF -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. Brazil -# Based on Third Sunday October to Last Sunday February at 1 am. -#********************************************************************** - - $BZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 2 || $mm > 10) { - $BZL_DST=1; return 1; - } elsif ($mm >= 3 && $mm <= 9) { - $BZL_DST=0; return 0; - } elsif ($mm == 2) { - if ($dd < 22) { - $BZL_DST=1; return 1; - } elsif ($dd < ($dow+22)) { - $BZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $BZL_DST=1; return 1; - } else { - $BZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $BZL_DST=1; return 1; - } else { - $BZL_DST=0; return 0; - } - } - } else { - $BZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 22) { - $BZL_DST=0; return 0; - } elsif ($dd < ($dow+22)) { - $BZL_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $BZL_DST=0; return 0; - } else { - $BZL_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $BZL_DST=0; return 0; - } else { - $BZL_DST=1; return 1; - } - } - } else { - $BZL_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc diff --git a/LANG_www/vicidial_en/new_listloader_superL.php b/LANG_www/vicidial_en/new_listloader_superL.php deleted file mode 100644 index 629321ed..00000000 --- a/LANG_www/vicidial_en/new_listloader_superL.php +++ /dev/null @@ -1,2069 +0,0 @@ - LICENSE: GPLv2 -# -# AST GUI lead loader from formatted file -# -# CHANGES -# 50602-1640 - First version created by Joe Johnson -# 51128-1108 - Removed PHP global vars requirement -# 60113-1603 - Fixed a few bugs in Excel import -# 60421-1624 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60616-1240 - added listID override -# 60616-1604 - added gmt lookup for each lead -# 60619-1651 - Added variable filtering to eliminate SQL injection attack threat -# 60822-1121 - fixed for nonwritable directories -# 60906-1100 - added filter of non-digits in alt_phone field -# 61110-1222 - added new USA-Canada DST scheme and Brazil DST scheme -# 61128-1149 - added postal code GMT lookup and duplicate check options -# 70417-1059 - Fixed default phone_code bug -# 70510-1518 - Added campaign and system duplicate check and phonecode override -# -# 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'; - - -require("dbconnect.php"); - -### links used for testing -#$link=mysql_connect("10.10.10.15", "cron", "1234"); -#mysql_select_db("asterisk"); -#$WeBServeRRooT = '/home/www/htdocs'; - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -$leadfile=$_FILES["leadfile"]; - $LF_orig = $_FILES['leadfile']['name']; - $LF_path = $_FILES['leadfile']['tmp_name']; -if (isset($_GET["submit_file"])) {$submit_file=$_GET["submit_file"];} - elseif (isset($_POST["submit_file"])) {$submit_file=$_POST["submit_file"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["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($_GET["file_layout"])) {$file_layout=$_GET["file_layout"];} - elseif (isset($_POST["file_layout"])) {$file_layout=$_POST["file_layout"];} -if (isset($_GET["OK_to_process"])) {$OK_to_process=$_GET["OK_to_process"];} - elseif (isset($_POST["OK_to_process"])) {$OK_to_process=$_POST["OK_to_process"];} -if (isset($_GET["vendor_lead_code_field"])) {$vendor_lead_code_field=$_GET["vendor_lead_code_field"];} - elseif (isset($_POST["vendor_lead_code_field"])) {$vendor_lead_code_field=$_POST["vendor_lead_code_field"];} -if (isset($_GET["source_id_field"])) {$source_id_field=$_GET["source_id_field"];} - elseif (isset($_POST["source_id_field"])) {$source_id_field=$_POST["source_id_field"];} -if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} - elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} -if (isset($_GET["phone_code_field"])) {$phone_code_field=$_GET["phone_code_field"];} - elseif (isset($_POST["phone_code_field"])) {$phone_code_field=$_POST["phone_code_field"];} -if (isset($_GET["phone_number_field"])) {$phone_number_field=$_GET["phone_number_field"];} - elseif (isset($_POST["phone_number_field"])) {$phone_number_field=$_POST["phone_number_field"];} -if (isset($_GET["title_field"])) {$title_field=$_GET["title_field"];} - elseif (isset($_POST["title_field"])) {$title_field=$_POST["title_field"];} -if (isset($_GET["first_name_field"])) {$first_name_field=$_GET["first_name_field"];} - elseif (isset($_POST["first_name_field"])) {$first_name_field=$_POST["first_name_field"];} -if (isset($_GET["middle_initial_field"])) {$middle_initial_field=$_GET["middle_initial_field"];} - elseif (isset($_POST["middle_initial_field"])) {$middle_initial_field=$_POST["middle_initial_field"];} -if (isset($_GET["last_name_field"])) {$last_name_field=$_GET["last_name_field"];} - elseif (isset($_POST["last_name_field"])) {$last_name_field=$_POST["last_name_field"];} -if (isset($_GET["address1_field"])) {$address1_field=$_GET["address1_field"];} - elseif (isset($_POST["address1_field"])) {$address1_field=$_POST["address1_field"];} -if (isset($_GET["address2_field"])) {$address2_field=$_GET["address2_field"];} - elseif (isset($_POST["address2_field"])) {$address2_field=$_POST["address2_field"];} -if (isset($_GET["address3_field"])) {$address3_field=$_GET["address3_field"];} - elseif (isset($_POST["address3_field"])) {$address3_field=$_POST["address3_field"];} -if (isset($_GET["city_field"])) {$city_field=$_GET["city_field"];} - elseif (isset($_POST["city_field"])) {$city_field=$_POST["city_field"];} -if (isset($_GET["state_field"])) {$state_field=$_GET["state_field"];} - elseif (isset($_POST["state_field"])) {$state_field=$_POST["state_field"];} -if (isset($_GET["province_field"])) {$province_field=$_GET["province_field"];} - elseif (isset($_POST["province_field"])) {$province_field=$_POST["province_field"];} -if (isset($_GET["postal_code_field"])) {$postal_code_field=$_GET["postal_code_field"];} - elseif (isset($_POST["postal_code_field"])) {$postal_code_field=$_POST["postal_code_field"];} -if (isset($_GET["country_code_field"])) {$country_code_field=$_GET["country_code_field"];} - elseif (isset($_POST["country_code_field"])) {$country_code_field=$_POST["country_code_field"];} -if (isset($_GET["gender_field"])) {$gender_field=$_GET["gender_field"];} - elseif (isset($_POST["gender_field"])) {$gender_field=$_POST["gender_field"];} -if (isset($_GET["date_of_birth_field"])) {$date_of_birth_field=$_GET["date_of_birth_field"];} - elseif (isset($_POST["date_of_birth_field"])) {$date_of_birth_field=$_POST["date_of_birth_field"];} -if (isset($_GET["alt_phone_field"])) {$alt_phone_field=$_GET["alt_phone_field"];} - elseif (isset($_POST["alt_phone_field"])) {$alt_phone_field=$_POST["alt_phone_field"];} -if (isset($_GET["email_field"])) {$email_field=$_GET["email_field"];} - elseif (isset($_POST["email_field"])) {$email_field=$_POST["email_field"];} -if (isset($_GET["security_phrase_field"])) {$security_phrase_field=$_GET["security_phrase_field"];} - elseif (isset($_POST["security_phrase_field"])) {$security_phrase_field=$_POST["security_phrase_field"];} -if (isset($_GET["comments_field"])) {$comments_field=$_GET["comments_field"];} - elseif (isset($_POST["comments_field"])) {$comments_field=$_POST["comments_field"];} -if (isset($_GET["list_id_override"])) {$list_id_override=$_GET["list_id_override"];} - elseif (isset($_POST["list_id_override"])) {$list_id_override=$_POST["list_id_override"];} - $list_id_override = (preg_replace("/\D/","",$list_id_override)); -if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} - elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} -if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} - elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} -if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} - elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} -if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} - elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} - $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); - -# $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} - - -$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"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - - -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -$admDIR = "$HTTPprotocol$server_name$script_name"; -$admDIR = eregi_replace('new_listloader_superL.php','',$admDIR); -$admSCR = 'admin.php'; -$NWB = "   \"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"; - -function macfontfix($fontsize) { - - $browser = getenv("HTTP_USER_AGENT"); - $pctype = explode("(", $browser); - if (ereg("Mac",$pctype[1])) { - /* Browser is a Mac. If not Netscape 6, raise fonts */ - - $blownbrowser = explode('/', $browser); - $ver = explode(' ', $blownbrowser[1]); - $ver = $ver[0]; - if ($ver >= 5.0) return $fontsize; else return ($fontsize+2); - - } else return $fontsize; /* Browser is not a Mac - don't touch fonts */ -} - -echo "\n"; - -?> - - - -VICIDIAL ADMIN: Lead Loader - - -
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - - -
\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 ### -} -?> +?> \ No newline at end of file diff --git a/LANG_www/vicidial_en/admin_modify_lead.php b/LANG_www/vicidial_en/admin_modify_lead.php deleted file mode 100644 index f8a285ec..00000000 --- a/LANG_www/vicidial_en/admin_modify_lead.php +++ /dev/null @@ -1,610 +0,0 @@ - LICENSE: GPLv2 -# - -# CHANGES -# -# 70702-1259 - Added recording location link and truncation -# 70906-2132 - Added closer_log records display -# - -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"];} -if (isset($_GET["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_GET["CBchangeUSERtoANY"];} - elseif (isset($_POST["CBchangeUSERtoANY"])) {$CBchangeUSERtoANY=$_POST["CBchangeUSERtoANY"];} -if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeUSERtoUSER"];} - elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} -if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} - elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} -if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} - elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} -if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} - elseif (isset($_POST["CBuser"])) {$CBuser=$_POST["CBuser"];} -if (isset($_GET["modify_logs"])) {$modify_logs=$_GET["modify_logs"];} - elseif (isset($_POST["modify_logs"])) {$modify_logs=$_POST["modify_logs"];} - - -$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); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - - if($auth>0) - { - $stmt="SELECT full_name,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead record modification - - -
-VICIDIAL ADMIN: Lead record modification
\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) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "information modified

\n"; - echo "\n"; - - if ( ($dispo != $status) and ($dispo == 'CBHOLD') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status='ACTIVE';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - if ( ($dispo != $status) and ($dispo == 'CALLBK') ) - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record inactivated: $lead_id
\n"; - } - - if ( ($dispo != $status) and ($status == 'DNC') ) - { - ### add lead to the internal DNC list - $stmt="INSERT INTO vicidial_dnc (phone_number) values('" . mysql_real_escape_string($phone_number) . "');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
Lead added to DNC List: $lead_id - $phone_number
\n"; - } - ### update last record in vicidial_agent_log and vicidial_log tables - 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); - - $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); - } - -} -else -{ - - if ($CBchangeUSERtoANY == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to ANYONE
\n"; - } - if ($CBchangeUSERtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record user changed to $CBuser
\n"; - } - if ($CBchangeANYtoUSER == 'YES') - { - ### inactivate vicidial_callbacks record for this lead - $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; - } - - - - $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_count = $row[0]; - - if ($lead_count > 0) - { - - $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); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= "
"; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - } - - $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); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - } - - $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]"; - $dispo = "$row[3]"; - $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 "
$u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]
$y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\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:
Province :
Country :
Alt Phone :
Email :
Security :
Comments :
Disposition: (with $log_campaign statuses)
Modify agent and vicidial logs
\n"; - echo "


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

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

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

\n"; - } - } - else - { - echo "
No Callback records found
\n"; - } - } - - - - - - - } - else - { - echo "lead lookup FAILED for lead_id $lead_id       $NOW_TIME\n

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

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

\n"; - -echo "
\n"; - -echo "CALLS TO THIS LEAD:\n"; -echo "\n"; -echo "\n"; - - echo "$call_log\n"; - -echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD
\n"; -echo "

\n"; - -echo "CLOSER RECORDS FOR THIS LEAD:\n"; -echo "\n"; -echo "\n"; - - echo "$closer_log\n"; - -echo "
# DATE/TIME LENGTH STATUS TSR CAMPAIGN LIST LEAD WAIT
\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); - - $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 ""; - echo "\n"; - - } - - -echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATIONTSR
$u $row[12] $row[4] $row[8] $row[0]   $row[10] $location $row[13]
\n"; - - - - -} - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


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


\nscript runtime: $RUNtime seconds
"; - - -?> - - - - - - - - - - - diff --git a/LANG_www/vicidial_en/admin_search_lead.php b/LANG_www/vicidial_en/admin_search_lead.php deleted file mode 100644 index ff814159..00000000 --- a/LANG_www/vicidial_en/admin_search_lead.php +++ /dev/null @@ -1,225 +0,0 @@ - LICENSE: GPLv2 -### -### 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 -# - -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["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); - -$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); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -if ($WeBRooTWritablE > 0) - {$fp = fopen ("./project_auth_entries.txt", "a");} - -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "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,modify_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname =$row[0]; - $LOGmodify_leads =$row[1]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - - - -VICIDIAL ADMIN: Lead Search - -Lead Lookup - - -VICIDIAL ADMIN: Lead search
\n"; - - -if ( (!$vendor_id) and (!$phone) and (!$lead_id) ) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "
\n"; - echo "\n"; - echo "Please enter a:
Vendor ID(vendor lead code): or \n"; - echo "
a Home Phone Number: or\n"; - echo "
a lead ID:

\n"; - echo "
\n"; - echo "\n
\n"; - echo "\n"; - exit; - } - -else - { - - if ($vendor_id) - { - $stmt="SELECT * from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "' order by modify_date desc limit 1000"; - } - else - { - if ($phone) - { - $stmt="SELECT * from vicidial_list where phone_number='" . mysql_real_escape_string($phone) . "' order by modify_date desc limit 1000"; - } - else - { - if ($lead_id) - { - $stmt="SELECT * from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "' order by modify_date desc limit 1000"; - } - else - { - print "ERROR: you must search for something! Go back and search for something"; - exit; - } - } - } - if ($DB) - { - echo "\n\n$stmt\n\n"; - } - - $rslt=mysql_query($stmt, $link); - $results_to_print = mysql_num_rows($rslt); - if ($results_to_print < 1) - { - echo date("l F j, Y G:i:s A"); - echo "\n

\n"; - echo "The search variables you entered are not active in the system

\n"; - echo "Please go back and double check the information you entered and submit again\n"; - echo "
\n"; - echo "\n"; - exit; - } - else - { - echo "RESULTS: $results_to_print

\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $o=0; - while ($results_to_print > $o) - { - $row=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 "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo "
#LEAD IDSTATUSVENDOR IDLAST AGENTLIST IDPHONENAMECITYSECURITYLAST CALL
$o$row[0]$row[3]$row[5]$row[4]$row[7]$row[11]$row[13] $row[15]$row[19]$row[28]$row[2]
\n"; - } - } - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


\nNEW SEARCH"; - - -echo "\n\n\n


\nscript runtime: $RUNtime seconds"; - - -?> - - - - - diff --git a/LANG_www/vicidial_en/count.htm b/LANG_www/vicidial_en/count.htm deleted file mode 100644 index 51f8a361..00000000 --- a/LANG_www/vicidial_en/count.htm +++ /dev/null @@ -1 +0,0 @@ - diff --git a/LANG_www/vicidial_en/dbconnect.php b/LANG_www/vicidial_en/dbconnect.php deleted file mode 100644 index 5247e166..00000000 --- a/LANG_www/vicidial_en/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_en/group_hourly_stats.php b/LANG_www/vicidial_en/group_hourly_stats.php deleted file mode 100644 index 607f2fd7..00000000 --- a/LANG_www/vicidial_en/group_hourly_stats.php +++ /dev/null @@ -1,252 +0,0 @@ - LICENSE: GPLv2 -### -# CHANGES -# -# 60620-1014 - 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["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["date_with_hour"])) {$date_with_hour=$_GET["date_with_hour"];} - elseif (isset($_POST["date_with_hour"])) {$date_with_hour=$_POST["date_with_hour"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["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"); -$date_with_hour_default = date("Y-m-d H"); -$date_no_hour_default = $TODAY; - -if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} - $date_no_hour = $date_with_hour; - $date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - -# $stmt="SELECT full_name from vicidial_users where user='$user';"; -# $rslt=mysql_query($stmt, $link); -# $row=mysql_fetch_row($rslt); -# $full_name = $row[0]; - - } - - - - -?> - - -VICIDIAL ADMIN: Group Hourly Stats -\n"; -?> - - -
- - - - - -= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDtotal[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_no_hour) . " 00:00:00' and call_date <= '" . mysql_real_escape_string($date_no_hour) . " 23:59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDday[$o] = "$row[0]"; - - $stmt="select count(*) from vicidial_log where call_date >= '" . mysql_real_escape_string($date_with_hour) . ":00:00' and call_date <= '" . mysql_real_escape_string($date_with_hour) . ":59:59' and user='$VDuser[$o]' and status='" . mysql_real_escape_string($status) . "';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $VDcount[$o] = "$row[0]"; - $o++; - } - -echo "
" ?>   VICIDIAL ADMIN: Group Hourly Stats  
\n"; - -echo "
\n"; - -echo "TSR HOUR COUNTS: $group | $status | $date_with_hour | $date_no_hour\n"; - -echo "
\n"; -echo "\n"; - - $day_calls=0; - $hour_calls=0; - $total_calls=0; - $o=0; - while($o < $tsrs_to_print) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $total_calls = ($total_calls + $VDtotal[$o]); - $hour_calls = ($hour_calls + $VDcount[$o]); - $day_calls = ($day_calls + $VDday[$o]); - - $o++; - } - -echo "\n"; - - -} - -echo "
TSR ID   $status   TOTAL CALLS   $status DAY    
$VDuser[$o] $VDname[$o] $VDcount[$o] $VDtotal[$o] $VDday[$o]MODIFY | STATS
TOTAL $status $hour_calls $total_calls $day_calls
\n"; -echo "

\n"; - - - echo "
Please enter the group you want to get hourly stats for:
\n"; - echo "\n"; - echo "group:
\n"; - echo "status:   (example: XFER)
\n"; - echo "date with hour:   (example: 2004-06-25 14)
\n"; - echo "\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_en/help.gif b/LANG_www/vicidial_en/help.gif deleted file mode 100644 index 5575d7c8761954a943a67f99265cc408edfeca37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 492 zcmV@K zrlzK7XlVcc{(zdZkfy!h=k1@f#?ad1KW2>Z^Y)^mqV4VLXlQ0|jj7+?-?g=~@9*#a z|NoMak9c=?>FMXq%*)5e#og%my1BWCh=?#*gAYJ&zrMYsqoV%*{r~>|{{H^||Nj6p zX13G(A^8LW002J#EC2ui02BZe000L6z@KnPEE=r$6g+ktoje(cAZZc{4nh|!Jvux)X@@=m zC21-y7sABGX&Z<(B|AJC&(S}$JRWB|DXBdgJUkNs!9S#?9v(X*xM}G+D<}p+2b5_V z8b~1O;i1q87Yz;w5oDsk4s-&2^x#n-!huJTe#ntg$k2xm+8(U%L!-zT3@08O+Yv#+ i0XJ}rR3Wh7fCU;Dx+Ew$Wrh+7CQhJ)nL_kP5CA(E_TC-< diff --git a/LANG_www/vicidial_en/listloader.php b/LANG_www/vicidial_en/listloader.php deleted file mode 100644 index b6e8ae5e..00000000 --- a/LANG_www/vicidial_en/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_en/listloader.pl b/LANG_www/vicidial_en/listloader.pl deleted file mode 100644 index d926368b..00000000 --- a/LANG_www/vicidial_en/listloader.pl +++ /dev/null @@ -1,1084 +0,0 @@ -#!/usr/bin/perl - -### listloader.pl version 0.4 *DBI-version* -### -### Copyright (C) 2007 Matt Florell,Joe Johnson LICENSE: GPLv2 -### -# -# -# CHANGES -# 60616-1548 - Added listID override feature to force all leads into same list -# - Added gmt_offset_now lookup for each lead -# 60811-1232 - Changed to DBI -# 60811-1329 - changed to use /etc/astguiclient.conf for configs -# 60822-1121 - fixed for nonwritable directories -# 60906-1058 - added filter of non-digits in alt_phone field -# 61110-1229 - added new USA-Canada DST scheme and Brazil DST scheme -# 61128-1215 - added postal code GMT lookup and duplicate check options -# 70205-1703 - Defaulted phone_code to 1 if not populated -# 70417-1059 - Fixed default phone_code bug -# 70510-1518 - Added campaign and system duplicate check and phonecode override -# - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - - exit; - } - else - { - if ($args =~ /-duplicate-check/i) - {$dupcheck=1;} - if ($args =~ /-duplicate-campaign-check/i) - {$dupcheckcamp=1;} - if ($args =~ /-duplicate-system-check/i) - {$dupchecksys=1;} - if ($args =~ /-postal-code-gmt/i) - {$postalgmt=1;} - if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); - $forcelistid = $data_in[1]; - $forcelistid =~ s/ .*//gi; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } - else - {$forcelistid = '';} - - if ($args =~ /--forcephonecode=/i) - { - @data_in = split(/--forcephonecode=/,$args); - $forcephonecode = $data_in[1]; - $forcephonecode =~ s/ .*//gi; - print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; - } - else - {$forcephonecode = '';} - - if ($args =~ /--lead-file=/i) - { - @data_in = split(/--lead-file=/,$args); - $lead_file = $data_in[1]; - $lead_file =~ s/ .*//gi; - # print "\n----- LEAD FILE: $lead_file -----\n\n"; - } - else - {$lead_file = './vicidial_temp_file.xls';} - } -} -### end parsing run-time options ### - - -use Spreadsheet::ParseExcel; -use Time::Local; -use DBI; - - -# default path to astguiclient configuration file: -$PATHconf = '/etc/astguiclient.conf'; - -open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; -@conf = ; -close(conf); -$i=0; -foreach(@conf) - { - $line = $conf[$i]; - $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; - if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) - {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} - if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) - {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} - if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) - {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} - if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) - {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} - if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) - {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} - if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) - {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} - if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) - {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) - {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) - {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) - {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) - {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) - {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} - $i++; - } - -# Customized Variables -$server_ip = $VARserver_ip; # Asterisk server IP - -if (!$VARDB_port) {$VARDB_port='3306';} - -$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") - or die "Couldn't connect to database: " . DBI->errstr; - - -$|=0; -$secX = time(); - -($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); -$year = ($year + 1900); -$mon++; -if ($hour < 10) {$hour = "0$hour";} -if ($min < 10) {$min = "0$min";} -if ($sec < 10) {$sec = "0$sec";} -if ($mon < 10) {$mon = "0$mon";} -if ($mday < 10) {$mday = "0$mday";} -$pulldate0 = "$year-$mon-$mday $hour:$min:$sec"; -$pulldate="$year-$mon-$mday $hour:$min:$sec"; -$inSD = $pulldate0; -$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - - ### Grab Server values from the database - $stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $DBSERVER_GMT = "$aryA[0]"; - if ($DBSERVER_GMT) {$SERVER_GMT = $DBSERVER_GMT;} - $rec_count++; - } - $sthA->finish(); - - $LOCAL_GMT_OFF = $SERVER_GMT; - $LOCAL_GMT_OFF_STD = $SERVER_GMT; - -if ($isdst) {$LOCAL_GMT_OFF++;} -if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";} - - - -$total=0; $good=0; $bad=0; -print "
Processing Excel file...\n"; -open(STMT_FILE, "> $PATHlogs/listloader_stmts.txt"); - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); -my($iR, $iC, $oWkS, $oWkC); - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for($iR = 0 ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { - - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user = ""; - $oWkC = $oWkS->{Cells}[$iR][0]; - if ($oWkC) {$vendor_lead_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][1]; - if ($oWkC) {$source_code=$oWkC->Value; } - $source_id=$source_code; - $oWkC = $oWkS->{Cells}[$iR][2]; - if ($oWkC) {$list_id=$oWkC->Value; } - $gmt_offset = '0'; - $called_since_last_reset='N'; - $oWkC = $oWkS->{Cells}[$iR][3]; - if ($oWkC) {$phone_code=$oWkC->Value; } - $phone_code=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][4]; - if ($oWkC) {$phone_number=$oWkC->Value; } - $phone_number=~s/[^0-9]//g; - $USarea = substr($phone_number, 0, 3); - $oWkC = $oWkS->{Cells}[$iR][5]; - if ($oWkC) {$title=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][6]; - if ($oWkC) {$first_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][7]; - if ($oWkC) {$middle_initial=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][8]; - if ($oWkC) {$last_name=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][9]; - if ($oWkC) {$address1=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][10]; - if ($oWkC) {$address2=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][11]; - if ($oWkC) {$address3=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][12]; - if ($oWkC) {$city=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][13]; - if ($oWkC) {$state=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][14]; - if ($oWkC) {$province=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][15]; - if ($oWkC) {$postal_code=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][16]; - if ($oWkC) {$country=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][17]; - if ($oWkC) {$gender=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][18]; - if ($oWkC) {$date_of_birth=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][19]; - if ($oWkC) {$alt_phone=$oWkC->Value; } - $alt_phone=~s/[^0-9]//g; - $oWkC = $oWkS->{Cells}[$iR][20]; - if ($oWkC) {$email=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][21]; - if ($oWkC) {$security_phrase=$oWkC->Value; } - $oWkC = $oWkS->{Cells}[$iR][22]; - if ($oWkC) {$comments=$oWkC->Value; } - $comments=~s/^\s*(.*?)\s*$/$1/; - - if (length($forcelistid) > 0) - { - $list_id = $forcelistid; # set list_id to override value - } - if (length($forcephonecode) > 0) - { - $phone_code = $forcephonecode; # set phone_code to override value - } - - ##### Check for duplicate phone numbers in vicidial_list table entire database ##### - if ($dupchecksys > 0) - { - $dup_lead=0; - $stmtA = "select count(*) from vicidial_list where phone_number='$phone_number';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $dup_lead = $aryA[0]; - $dup_lead_list=$list_id; - } - $sthA->finish(); - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### - if ($dupcheck > 0) - { - $dup_lead=0; - $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id='$list_id' limit 1;"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - if ($sthArows > 0) - { - @aryA = $sthA->fetchrow_array; - $dup_lead_list = $aryA[0]; - $dup_lead++; - } - $sthA->finish(); - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### - if ($dupcheckcamp > 0) - { - $dup_lead=0; - $dup_lists=''; - - $stmtA = "select count(*) from vicidial_lists where list_id='$list_id';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - @aryA = $sthA->fetchrow_array; - $ci_recs = $aryA[0]; - $sthA->finish(); - if ($ci_recs > 0) - { - $stmtA = "select campaign_id from vicidial_lists where list_id='$list_id';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - @aryA = $sthA->fetchrow_array; - $dup_camp = $aryA[0]; - $sthA->finish(); - - $stmtA = "select list_id from vicidial_lists where campaign_id='$dup_camp';"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $dup_lists .= "'$aryA[0]',"; - $rec_count++; - } - $sthA->finish(); - - chop($dup_lists); - $stmtA = "select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $dup_lead_list = "'$aryA[0]',"; - $rec_count++; - $dup_lead=1; - } - $sthA->finish(); - } - if ($dup_lead < 1) - { - if ($phone_list =~ /\|$phone_number$US$list_id\|/) - {$dup_lead++;} - } - } - - if ( (length($phone_number)>6) && ($dup_lead < 1) ) - { - $phone_list .= "$phone_number$US$list_id|"; - $postalgmt_found=0; - if (length($phone_code)<1) {$phone_code = '1';} - - if ( ($postalgmt > 0) && (length($postal_code)>4) ) - { - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_postal_codes where country_code='$phone_code' and postal_code LIKE \"$postal_code%\";"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[2]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[3]; - $dst_range = $aryA[4]; - $PC_processed++; - $rec_count++; - $postalgmt_found++; - if ($DBX) {print " Postal GMT record found for $postal_code: |$gmt_offset|$dst|$dst_range|\n";} - } - $sthA->finish(); - } - } - if ($postalgmt_found < 1) - { - $PC_processed=0; - ### UNITED STATES ### - if ($phone_code =~ /^1$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### MEXICO ### - if ($phone_code =~ /^52$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### AUSTRALIA ### - if ($phone_code =~ /^61$/) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - ### ALL OTHER COUNTRY CODES ### - if (!$PC_processed) - { - $stmtA = "select * from vicidial_phone_codes where country_code='$phone_code';"; - if($DBX){print STDERR "\n|$stmtA|\n";} - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $rec_count=0; - while ($sthArows > $rec_count) - { - @aryA = $sthA->fetchrow_array; - $gmt_offset = $aryA[4]; $gmt_offset =~ s/\+| //gi; - $dst = $aryA[5]; - $dst_range = $aryA[6]; - $PC_processed++; - $rec_count++; - } - $sthA->finish(); - } - } - - ### Find out if DST to raise the gmt offset ### - $AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD); - $AC_localtime = ($secX + (3600 * $AC_GMT_diff)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($AC_localtime); - $year = ($year + 1900); - $mon++; - if ($mon < 10) {$mon = "0$mon";} - if ($mday < 10) {$mday = "0$mday";} - if ($hour < 10) {$hour = "0$hour";} - if ($min < 10) {$min = "0$min";} - if ($sec < 10) {$sec = "0$sec";} - $dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec ); - - $AC_processed=0; - - if ( (!$AC_processed) && ($dst_range =~ /SSM-FSN/) ) - { - if ($DBX) {print " Second Sunday March to First Sunday November\n";} - &USACAN_dstcalc; - if ($DBX) {print " DST: $USACAN_DST\n";} - if ($USACAN_DST) {$area_GMT++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSA-LSO/) ) - { - if ($DBX) {print " First Sunday April to Last Sunday October\n";} - &NA_dstcalc; - if ($DBX) {print " DST: $NA_DST\n";} - if ($NA_DST) {$area_GMT++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSM-LSO/) ) - { - if ($DBX) {print " Last Sunday March to Last Sunday October\n";} - &GBR_dstcalc; - if ($DBX) {print " DST: $GBR_DST\n";} - if ($GBR_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /LSO-LSM/) ) - { - if ($DBX) {print " Last Sunday October to Last Sunday March\n";} - &AUS_dstcalc; - if ($DBX) {print " DST: $AUS_DST\n";} - if ($AUS_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-LSM/) ) - { - if ($DBX) {print " First Sunday October to Last Sunday March\n";} - &AUST_dstcalc; - if ($DBX) {print " DST: $AUST_DST\n";} - if ($AUST_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /FSO-TSM/) ) - { - if ($DBX) {print " First Sunday October to Third Sunday March\n";} - &NZL_dstcalc; - if ($DBX) {print " DST: $NZL_DST\n";} - if ($NZL_DST) {$gmt_offset++;} - $AC_processed++; - } - if ( (!$AC_processed) && ($dst_range =~ /TSO-LSF/) ) - { - if ($DBX) {print " Third Sunday October to Last Sunday February\n";} - &BZL_dstcalc; - if ($DBX) {print " DST: $BZL_DST\n";} - if ($BZL_DST) {$area_GMT++;} - $AC_processed++; - } - if (!$AC_processed) - { - if ($DBX) {print " No DST Method Found\n";} - if ($DBX) {print " DST: 0\n";} - $AC_processed++; - } - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; - $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),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list\n";} - $bad++; - } - $total++; - if ($total%100==0) { - print ""; - sleep(1); -# flush(); - } - } -} - -if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list values ".substr($multistmt, 0, -1).";"; - $affected_rows = $dbhA->do($stmtZ); - print STMT_FILE $stmtZ."\r\n"; -} - -print "

Done
GOOD: $good       BAD: $bad       TOTAL: $total
"; - -exit; - - - - - - -sub USACAN_dstcalc { -#********************************************************************** -# SSM-FSN -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on Second Sunday March to First Sunday November at 2 am. -# INPUTS: -# mm INTEGER Month. -# dd INTEGER Day of the month. -# ns INTEGER Seconds into the day. -# dow INTEGER Day of week (0=Sunday, to 6=Saturday) -# OPTIONAL INPUT: -# timezone INTEGER hour difference UTC - local standard time -# (DEFAULT is blank) -# make calculations based on UTC time, -# which means shift at 10:00 UTC in April -# and 9:00 UTC in October -# OUTPUT: -# INTEGER 1 = DST, 0 = not DST -# -# S M T W T F S -# 1 2 3 4 5 6 7 -# 8 9 10 11 12 13 14 -#15 16 17 18 19 20 21 -#22 23 24 25 26 27 28 -#29 30 31 -# -# S M T W T F S -# 1 2 3 4 5 6 -# 7 8 9 10 11 12 13 -#14 15 16 17 18 19 20 -#21 22 23 24 25 26 27 -#28 29 30 31 -# -#********************************************************************** - - $USACAN_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 11) { - $USACAN_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 10) { - $USACAN_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd > 13) { - $USACAN_DST=1; return 1; - } elsif ($dd >= ($dow+8)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $USACAN_DST=0; return 0; - } else { - $USACAN_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $USACAN_DST=0; return 0; - } else { - $USACAN_DST=1; return 1; - } - } - } else { - $USACAN_DST=0; return 0; - } - } elsif ($mm == 11) { - if ($dd > 7) { - $USACAN_DST=0; return 0; - } elsif ($dd < ($dow+1)) { - $USACAN_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $USACAN_DST=1; return 1; - } else { - $USACAN_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $USACAN_DST=1; return 1; - } else { - $USACAN_DST=0; return 0; - } - } - } else { - $USACAN_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub NA_dstcalc { -#********************************************************************** -# FSA-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in April and last Sunday in October at 2 am. -#********************************************************************** - - $NA_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 4 || $mm > 10) { - $NA_DST=0; return 0; - } elsif ($mm >= 5 && $mm <= 9) { - $NA_DST=1; return 1; - } elsif ($mm == 4) { - if ($dd > 7) { - $NA_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NA_DST=0; return 0; - } else { - $NA_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 7200) { - $NA_DST=0; return 0; - } else { - $NA_DST=1; return 1; - } - } - } else { - $NA_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $NA_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $NA_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (7200+($timezone-1)*3600)) { - $NA_DST=1; return 1; - } else { - $NA_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 7200) { - $NA_DST=1; return 1; - } else { - $NA_DST=0; return 0; - } - } - } else { - $NA_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub GBR_dstcalc { -#********************************************************************** -# LSM-LSO -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in March and last Sunday in October at 1 am. -#********************************************************************** - - $GBR_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $GBR_DST=0; return 0; - } elsif ($mm >= 4 && $mm <= 9) { - $GBR_DST=1; return 1; - } elsif ($mm == 3) { - if ($dd < 25) { - $GBR_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $GBR_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=0; return 0; - } else { - $GBR_DST=1; return 1; - } - } - } else { - $GBR_DST=1; return 1; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $GBR_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $GBR_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $GBR_DST=1; return 1; - } else { - $GBR_DST=0; return 0; - } - } - } else { - $GBR_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub AUS_dstcalc { -#********************************************************************** -# LSO-LSM -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on last Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUS_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUS_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUS_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUS_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUS_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=1; return 1; - } else { - $AUS_DST=0; return 0; - } - } - } else { - $AUS_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 25) { - $AUS_DST=0; return 0; - } elsif ($dd < ($dow+25)) { - $AUS_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $AUS_DST=0; return 0; - } else { - $AUS_DST=1; return 1; - } - } - } else { - $AUS_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub AUST_dstcalc { -#********************************************************************** -# FSO-LSM -# TASMANIA ONLY -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and last Sunday in March at 1 am. -#********************************************************************** - - $AUST_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $AUST_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $AUST_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 25) { - $AUST_DST=1; return 1; - } elsif ($dd < ($dow+25)) { - $AUST_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $AUST_DST=1; return 1; - } else { - $AUST_DST=0; return 0; - } - } - } else { - $AUST_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd >= 8) { - $AUST_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $AUST_DST=0; return 0; - } else { - $AUST_DST=1; return 1; - } - } - } else { - $AUST_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - - -sub NZL_dstcalc { -#********************************************************************** -# FSO-TSM -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. -# Based on first Sunday in October and third Sunday in March at 1 am. -#********************************************************************** - - $NZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 3 || $mm > 10) { - $NZL_DST=1; return 1; - } elsif ($mm >= 4 && $mm <= 9) { - $NZL_DST=0; return 0; - } elsif ($mm == 3) { - if ($dd < 14) { - $NZL_DST=1; return 1; - } elsif ($dd < ($dow+14)) { - $NZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $NZL_DST=1; return 1; - } else { - $NZL_DST=0; return 0; - } - } - } else { - $NZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd >= 8) { - $NZL_DST=1; return 1; - } elsif ($dd >= ($dow+1)) { - if ($timezone) { - if ($dow == 0 && $ns < (7200+$timezone*3600)) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } else { - if ($dow == 0 && $ns < 3600) { - $NZL_DST=0; return 0; - } else { - $NZL_DST=1; return 1; - } - } - } else { - $NZL_DST=0; return 0; - } - } # end of month checks -} # end of subroutine dstcalc - - - - -sub BZL_dstcalc { -#********************************************************************** -# TSO-LSF -# This is returns 1 if Daylight Savings Time is in effect and 0 if -# Standard time is in effect. Brazil -# Based on Third Sunday October to Last Sunday February at 1 am. -#********************************************************************** - - $BZL_DST=0; - $mm = $mon; - $dd = $mday; - $ns = $dsec; - $dow= $wday; - - if ($mm < 2 || $mm > 10) { - $BZL_DST=1; return 1; - } elsif ($mm >= 3 && $mm <= 9) { - $BZL_DST=0; return 0; - } elsif ($mm == 2) { - if ($dd < 22) { - $BZL_DST=1; return 1; - } elsif ($dd < ($dow+22)) { - $BZL_DST=1; return 1; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $BZL_DST=1; return 1; - } else { - $BZL_DST=0; return 0; - } - } else { # local time calculations - if ($ns < 3600) { - $BZL_DST=1; return 1; - } else { - $BZL_DST=0; return 0; - } - } - } else { - $BZL_DST=0; return 0; - } - } elsif ($mm == 10) { - if ($dd < 22) { - $BZL_DST=0; return 0; - } elsif ($dd < ($dow+22)) { - $BZL_DST=0; return 0; - } elsif ($dow == 0) { - if ($timezone) { # UTC calculations - if ($ns < (3600+($timezone-1)*3600)) { - $BZL_DST=0; return 0; - } else { - $BZL_DST=1; return 1; - } - } else { # local time calculations - if ($ns < 3600) { - $BZL_DST=0; return 0; - } else { - $BZL_DST=1; return 1; - } - } - } else { - $BZL_DST=1; return 1; - } - } # end of month checks -} # end of subroutine dstcalc diff --git a/LANG_www/vicidial_en/listloaderMAIN.php b/LANG_www/vicidial_en/listloaderMAIN.php deleted file mode 100644 index bb292c36..00000000 --- a/LANG_www/vicidial_en/listloaderMAIN.php +++ /dev/null @@ -1,86 +0,0 @@ - LICENSE: GPLv2 -# -# this is the main frame page for the lead loading section. This is where you -# would upload a file and have it inserted into vicidial_list -# -# changes: -# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat -# 60822-1105 - fixed for nonwritable directories -# - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGload_leads =$row[0]; - - if ($LOGload_leads < 1) - { - echo "You do not have permissions to load leads\n"; - exit; - } - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - } - -?> - -VICIDIAL: Lead Loader Module - - - - - \ No newline at end of file diff --git a/LANG_www/vicidial_en/listloader_rowdisplay.pl b/LANG_www/vicidial_en/listloader_rowdisplay.pl deleted file mode 100644 index 3f8695c0..00000000 --- a/LANG_www/vicidial_en/listloader_rowdisplay.pl +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/perl - -### listloader_rowdisplay.pl version 0.2 *DBI-version* -### -### Copyright (C) 2006 Matt Florell,Joe Johnson LICENSE: GPLv2 -### -# -# CHANGES -# -# 60811-1232 - Changed to DBI -# 60811-1329 - changed to use /etc/astguiclient.conf for configs -# - -### begin parsing run-time options ### -if (length($ARGV[0])>1) -{ - $i=0; - while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } - - if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - - exit; - } - else - { - if ($args =~ /-duplicate-check/i) - {$dupcheck=1;} - if ($args =~ /-postal-code-gmt/i) - {$postalgmt=1;} - if ($args =~ /--lead-file=/i) - { - @data_in = split(/--lead-file=/,$args); - $lead_file = $data_in[1]; - $lead_file =~ s/ .*//gi; - # print "\n----- LEAD FILE: $lead_file -----\n\n"; - } - else - {$lead_file = './vicidial_temp_file.xls';} - } -} -### end parsing run-time options ### - -use Spreadsheet::ParseExcel; -use Time::Local; -use DBI; - - -# default path to astguiclient configuration file: -$PATHconf = '/etc/astguiclient.conf'; - -open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n"; -@conf = ; -close(conf); -$i=0; -foreach(@conf) - { - $line = $conf[$i]; - $line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi; - if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) ) - {$PATHhome = $line; $PATHhome =~ s/.*=//gi;} - if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) ) - {$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;} - if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) ) - {$PATHagi = $line; $PATHagi =~ s/.*=//gi;} - if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) ) - {$PATHweb = $line; $PATHweb =~ s/.*=//gi;} - if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) ) - {$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;} - if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) ) - {$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;} - if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) ) - {$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) ) - {$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) ) - {$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) ) - {$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) ) - {$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;} - if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) ) - {$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;} - $i++; - } - -# Customized Variables -$server_ip = $VARserver_ip; # Asterisk server IP - -if (!$VARDB_port) {$VARDB_port='3306';} - -$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass") - or die "Couldn't connect to database: " . DBI->errstr; - - -$oBook = Spreadsheet::ParseExcel::Workbook->Parse("$lead_file"); -my($iR, $iC, $oWkS, $oWkC); -$var_str=""; - -foreach $oWkS (@{$oBook->{Worksheet}}) { - for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { - $oWkC = $oWkS->{Cells}[0][$iC]; - if ($oWkC) { - $var_str.=$oWkC->Value."|"; - } else { - $var_str.="|"; - } - } -} - -@xls_row=split(/\|/, $var_str); - - -$stmtA = "select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1;"; -$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; -$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; -$sthArows=$sthA->rows; -$rec_count=0; -while ($sthArows > $rec_count) - { - my $names = $sthA->{'NAME'}; - my $numFields = $sthA->{'NUM_OF_FIELDS'}; - for (my $i = 0; $i < $numFields; $i++) - { - # printf("%s%s", $i ? "," : "", $$names[$i]); - # printf("%s%s", $i ? "," : "", $$ref[$i]); - - $field_name=uc($$names[$i]); - $field_name=~s/\_/ /g; - print "
".$field_name.": \r\n"; - print " \r\n"; - print "
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Load leads from this file:
List ID Override: (numbers only or leave blank for values in the file)
Phone Code Override: (numbers only or leave blank for values in the file)
File layout to use:Standard VICIDIAL    Custom layout
Lead Duplicate Check:
Lead Time Zone Lookup:
        
        BACK TO ADMINLIST LOADER-     VERSION:     BUILD:    
- - -document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; - flush(); - $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.txt"); - $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - { - $stmt_file=fopen("listloader_stmts.txt", "w"); - } - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$lead_file", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

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

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } - - ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### - if (eregi("DUPCAMP",$dupcheck)) - { - $dup_lead=0; - $dup_lists=''; - $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $ci_recs = mysql_num_rows($rslt); - if ($ci_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_camp = $row[0]; - - $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; - $rslt=mysql_query($stmt, $link); - $li_recs = mysql_num_rows($rslt); - if ($li_recs > 0) - { - $L=0; - while ($li_recs > $L) - { - $row=mysql_fetch_row($rslt); - $dup_lists .= "'$row[0]',"; - $L++; - } - $dup_lists = eregi_replace(",$",'',$dup_lists); - - $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - } - } - - ##### Check for duplicate phone numbers in vicidial_list table entire database ##### - if (eregi("DUPSYS",$dupcheck)) - { - $dup_lead=0; - $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### - if (eregi("DUPLIST",$dupcheck)) - { - $dup_lead=0; - $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_lead = $row[0]; - $dup_lead_list = $list_id; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) - { - if (strlen($phone_code)<1) {$phone_code = '1';} - - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $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";} - $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
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) { - # copy($leadfile, "./vicidial_temp_file.xls"); - $file=fopen("$lead_file", "r"); - - print "
Processing Excel file... \n"; - if (strlen($list_id_override)>0) - { - print "

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

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[$vendor_lead_code_field]; - $source_code = $row[$source_id_field]; - $source_id=$source_code; - $list_id = $row[$list_id_field]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); - $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); - $title = $row[$title_field]; - $first_name = $row[$first_name_field]; - $middle_initial = $row[$middle_initial_field]; - $last_name = $row[$last_name_field]; - $address1 = $row[$address1_field]; - $address2 = $row[$address2_field]; - $address3 = $row[$address3_field]; - $city =$row[$city_field]; - $state = $row[$state_field]; - $province = $row[$province_field]; - $postal_code = $row[$postal_code_field]; - $country_code = $row[$country_code_field]; - $gender = $row[$gender_field]; - $date_of_birth = $row[$date_of_birth_field]; - $alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); - $email = $row[$email_field]; - $security_phrase = $row[$security_phrase_field]; - $comments = trim($row[$comments_field]); - - if (strlen($list_id_override)>0) - { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } - - ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### - if (eregi("DUPCAMP",$dupcheck)) - { - $dup_lead=0; - $dup_lists=''; - $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $ci_recs = mysql_num_rows($rslt); - if ($ci_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_camp = $row[0]; - - $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; - $rslt=mysql_query($stmt, $link); - $li_recs = mysql_num_rows($rslt); - if ($li_recs > 0) - { - $L=0; - while ($li_recs > $L) - { - $row=mysql_fetch_row($rslt); - $dup_lists .= "'$row[0]',"; - $L++; - } - $dup_lists = eregi_replace(",$",'',$dup_lists); - - $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - } - } - - ##### Check for duplicate phone numbers in vicidial_list table entire database ##### - if (eregi("DUPSYS",$dupcheck)) - { - $dup_lead=0; - $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### - if (eregi("DUPLIST",$dupcheck)) - { - $dup_lead=0; - $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_lead = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) - { - if (strlen($phone_code)<1) {$phone_code = '1';} - - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10000) {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
"; - } - print ""; - } - -if ($leadfile && filesize($LF_path)<=8388608) { - $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; - if ($file_layout=="standard") { - - print ""; - flush(); - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { - - if ($WeBRooTWritablE > 0) - { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "./vicidial_temp_file.txt"; - } - else - { - copy($LF_path, "/tmp/vicidial_temp_file.txt"); - $lead_file = "/tmp/vicidial_temp_file.txt"; - } - $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - - if (count($field_check)>=5) { - flush(); - $file=fopen("$lead_file", "r"); - $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; - print "
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

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

\n"; - } - while (!feof($file)) { - $record++; - $buffer=rtrim(fgets($file, 4096)); - $buffer=stripslashes($buffer); - - if (strlen($buffer)>0) { - $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); - - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = eregi_replace("[^0-9]", "", $row[19]); - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($list_id_override)>0) - { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } - - ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### - if (eregi("DUPCAMP",$dupcheck)) - { - $dup_lead=0; - $dup_lists=''; - $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $ci_recs = mysql_num_rows($rslt); - if ($ci_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_camp = $row[0]; - - $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; - $rslt=mysql_query($stmt, $link); - $li_recs = mysql_num_rows($rslt); - if ($li_recs > 0) - { - $L=0; - while ($li_recs > $L) - { - $row=mysql_fetch_row($rslt); - $dup_lists .= "'$row[0]',"; - $L++; - } - $dup_lists = eregi_replace(",$",'',$dup_lists); - - $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - } - } - - ##### Check for duplicate phone numbers in vicidial_list table entire database ##### - if (eregi("DUPSYS",$dupcheck)) - { - $dup_lead=0; - $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### - if (eregi("DUPLIST",$dupcheck)) - { - $dup_lead=0; - $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_lead = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) - { - if (strlen($phone_code)<1) {$phone_code = '1';} - - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10000) {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
"; - - } else { - print "
ERROR: The file does not have the required number of fields to process it.
"; - } - } else if (!eregi(".csv", $leadfile_name)) - { - if ($WeBRooTWritablE > 0) - { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; - } - else - { - copy($LF_path, "/tmp/vicidial_temp_file.xls"); - $lead_file = "/tmp/vicidial_temp_file.xls"; - } - $file=fopen("$lead_file", "r"); - - # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; - $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} - if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} - if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} - if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); - - } - else - { - if ($WeBRooTWritablE > 0) - { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; - } - else - { - copy($LF_path, "/tmp/vicidial_temp_file.csv"); - $lead_file = "/tmp/vicidial_temp_file.csv"; - } - $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - print "
Processing CSV file... \n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; - } - - while($row=fgetcsv($file, 1000, ",")) { - $pulldate=date("Y-m-d H:i:s"); - $entry_date = "$pulldate"; - $modify_date = ""; - $status = "NEW"; - $user =""; - $vendor_lead_code = $row[0]; - $source_code = $row[1]; - $source_id=$source_code; - $list_id = $row[2]; - $gmt_offset = '0'; - $called_since_last_reset='N'; - $phone_code = eregi_replace("[^0-9]", "", $row[3]); - $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); - $title = $row[5]; - $first_name = $row[6]; - $middle_initial = $row[7]; - $last_name = $row[8]; - $address1 = $row[9]; - $address2 = $row[10]; - $address3 = $row[11]; - $city =$row[12]; - $state = $row[13]; - $province = $row[14]; - $postal_code = $row[15]; - $country_code = $row[16]; - $gender = $row[17]; - $date_of_birth = $row[18]; - $alt_phone = eregi_replace("[^0-9]", "", $row[19]); - $email = $row[20]; - $security_phrase = $row[21]; - $comments = trim($row[22]); - - if (strlen($list_id_override)>0) - { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } - - ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### - if (eregi("DUPCAMP",$dupcheck)) - { - $dup_lead=0; - $dup_lists=''; - $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $ci_recs = mysql_num_rows($rslt); - if ($ci_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_camp = $row[0]; - - $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; - $rslt=mysql_query($stmt, $link); - $li_recs = mysql_num_rows($rslt); - if ($li_recs > 0) - { - $L=0; - while ($li_recs > $L) - { - $row=mysql_fetch_row($rslt); - $dup_lists .= "'$row[0]',"; - $L++; - } - $dup_lists = eregi_replace(",$",'',$dup_lists); - - $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - } - } - - ##### Check for duplicate phone numbers in vicidial_list table entire database ##### - if (eregi("DUPSYS",$dupcheck)) - { - $dup_lead=0; - $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $dup_lead=1; - $row=mysql_fetch_row($rslt); - $dup_lead_list = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### - if (eregi("DUPLIST",$dupcheck)) - { - $dup_lead=0; - $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $pc_recs = mysql_num_rows($rslt); - if ($pc_recs > 0) - { - $row=mysql_fetch_row($rslt); - $dup_lead = $row[0]; - } - if ($dup_lead < 1) - { - if (eregi("$phone_number$US$list_id",$phone_list)) - {$dup_lead++; $dup++;} - } - } - - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) - { - if (strlen($phone_code)<1) {$phone_code = '1';} - - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; - - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - - - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list 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);"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0),"; - $multi_insert_counter++; - } - - $good++; - } else { - if ($bad < 10000) {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
"; - - } - print ""; - - } else { - print "
"; - flush(); - print "\r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments from vicidial_list limit 1", $link); - - - if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) - { - if ($WeBRooTWritablE > 0) - { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; - } - else - { - copy($LF_path, "/tmp/vicidial_temp_file.txt"); - $lead_file = "/tmp/vicidial_temp_file.txt"; - } - $file=fopen("$lead_file", "r"); - if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} - - $buffer=fgets($file, 4096); - $tab_count=substr_count($buffer, "\t"); - $pipe_count=substr_count($buffer, "|"); - - if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} - $field_check=explode($delimiter, $buffer); - flush(); - $file=fopen("$lead_file", "r"); - print "
Processing $delim_name-delimited file...\n"; - - if (strlen($list_id_override)>0) - { - print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

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

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

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

PHONE CODE OVERRIDE FOR THIS FILE: $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"; - print " \r\n"; - print " \r\n"; - print " \r\n"; - print "
VICIDIAL ColumnFile data
".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).":
$row[$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.
"; -} -?> - - - - - - - - -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; -} \ No newline at end of file diff --git a/LANG_www/vicidial_en/remote_dispo.php b/LANG_www/vicidial_en/remote_dispo.php deleted file mode 100644 index da249fba..00000000 --- a/LANG_www/vicidial_en/remote_dispo.php +++ /dev/null @@ -1,327 +0,0 @@ - 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 - -# CHANGES -# -# 60619-1626 - 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["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"];} - -$STARTtime = date("U"); -$TODAY = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_datetime = $STARTtime; - -$ext_context = 'demo'; -if (!isset($begin_date)) {$begin_date = $TODAY;} -if (!isset($end_date)) {$end_date = $TODAY;} - - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "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 REMOTE: Call Disposition -\n"; -?> - - -
- -"; - -if ($end_call > 0) -{ - -$call_length = ($STARTtime - $call_began); - - ### insert a NEW record to the vicidial_closer_log table - $stmt="UPDATE vicidial_closer_log set end_epoch='$STARTtime', length_in_sec='" . mysql_real_escape_string($call_length) . "', status='" . mysql_real_escape_string($status) . "', user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "' order by start_epoch desc limit 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',user='$PHP_AUTH_USER' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - - echo "Call has been dispositioned       $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_en/server_stats.php b/LANG_www/vicidial_en/server_stats.php deleted file mode 100644 index 8e509383..00000000 --- a/LANG_www/vicidial_en/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_en/user_stats.php b/LANG_www/vicidial_en/user_stats.php deleted file mode 100644 index ecd457f8..00000000 --- a/LANG_www/vicidial_en/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_en/user_status.php b/LANG_www/vicidial_en/user_status.php deleted file mode 100644 index ecffbc5c..00000000 --- a/LANG_www/vicidial_en/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_en/vdremote.php b/LANG_www/vicidial_en/vdremote.php deleted file mode 100644 index dfe11fa3..00000000 --- a/LANG_www/vicidial_en/vdremote.php +++ /dev/null @@ -1,602 +0,0 @@ - LICENSE: GPLv2 -# -# Changes -# 50307-1721 - First version -# 51123-1502 - removed requirement of PHP Globals=on -# 60421-1229 - check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat -# -# 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'; - -require("dbconnect.php"); - -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; -$PHP_SELF=$_SERVER['PHP_SELF']; -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} - elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["user"])) {$user=$_GET["user"];} - elseif (isset($_POST["user"])) {$user=$_POST["user"];} -if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} - elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} - elseif (isset($_POST["remote_agent_id"])) {$remote_agent_id=$_POST["remote_agent_id"];} -if (isset($_GET["user_start"])) {$user_start=$_GET["user_start"];} - elseif (isset($_POST["user_start"])) {$user_start=$_POST["user_start"];} -if (isset($_GET["number_of_lines"])) {$number_of_lines=$_GET["number_of_lines"];} - elseif (isset($_POST["number_of_lines"])) {$number_of_lines=$_POST["number_of_lines"];} -if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} - elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} -if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} - elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} -if (isset($_GET["status"])) {$status=$_GET["status"];} - elseif (isset($_POST["status"])) {$status=$_POST["status"];} -if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} - elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} -if (isset($_GET["groups"])) {$groups=$_GET["groups"];} - elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} -if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} -if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} - -if (!isset($force_logout)) {$force_logout = 0;} - -if ($force_logout) -{ - if( (strlen($PHP_AUTH_USER)>0) or (strlen($PHP_AUTH_PW)>0) ) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - } - echo "You have now logged out. Thank you\n"; - exit; -} - -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - - -$popup_page = './closer_popup.php'; -$STARTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 3;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; - -$fp = fopen ("./project_auth_entries.txt", "a"); -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); - - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) - { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - else - { - header ("Content-type: text/html; charset=utf-8"); - - if($auth>0) - { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - $stmt="SELECT count(*) from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $authx=$row[0]; - - if($authx>0) - { - $stmt="SELECT remote_agent_id,server_ip,number_of_lines from vicidial_remote_agents where user_start='$PHP_AUTH_USER';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id=$row[0]; - $server_ip=$row[1]; - if (!$number_of_lines) {$number_of_lines=$row[2];} - - fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - echo "This remote agent does not exist: |$PHP_AUTH_USER|\n"; - exit; - } - } - else - { - fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - -echo "\n"; -echo "\n"; -echo "\n"; -if ($ADD==61111) - { - echo"\n"; - } -echo "\n"; -?> - -VICIDIAL REMOTE AGENTS: $LOGfullname - $PHP_AUTH_USER "; - -if (!$ADD) {$ADD="31111";} -if ($ADD==31111) {echo "Modify Remote Agents";} -if ($ADD==41111) {echo "Modify Remote Agents";} -if ($ADD==61111) {echo "Remote Agent Status";} -if ($ADD==71111) {echo "Remote Agent Closer Stats";} - - -if (strlen($ADD)>4) - { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } - - ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - $campaigns_list=''; - - $o=0; - while ($campaigns_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $campaigns_list .= "\n"; - $o++; - } - - ##### get inbound groups listing for checkboxes - if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) - { - $stmt="SELECT closer_campaigns from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); - } - - $stmt="SELECT group_id,group_name from vicidial_inbound_groups order by group_id"; - $rslt=mysql_query($stmt, $link); - $groups_to_print = mysql_num_rows($rslt); - $groups_list=''; - $groups_value=''; - - $o=0; - while ($groups_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "2) {$groups_value .= " -";} - } - -?> - - - -
-
- - - -
  VICIDIAL REMOTE AGENTS:   Logout  
  MODIFY | ">STATUS | ">INBOUND STATS
-"; - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
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: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=41111 modify remote agents info in the system -###################### - -if ($ADD==41111) -{ - echo ""; - - if ( (strlen($number_of_lines) < 1) or (strlen($conf_exten) < 2) ) - {echo "
REMOTE AGENTS NOT MODIFIED - Please go back and look at the data you entered\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 "
REMOTE AGENTS MODIFIED\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"); - fclose($fp); - - } - - $stmt="SELECT * from vicidial_remote_agents where remote_agent_id='" . mysql_real_escape_string($remote_agent_id) . "';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $remote_agent_id = $row[0]; - $user_start = $row[1]; - $number_of_lines = $row[2]; - $server_ip = $row[3]; - $conf_exten = $row[4]; - $status = $row[5]; - $campaign_id = $row[6]; - -echo "
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: $user_start
Number of Lines: (numbers only)
Server IP: $row[3]
External Extension: (number dialed to reach agents [i.e. 913125551212])
Status:
Campaign: $campaign_id
Inbound Groups: \n"; -echo "$groups_list"; -echo "
\n"; -echo "NOTE: It can take up to 30 seconds for changes submitted on this screen to go live\n"; - -} - - - - -###################### -# ADD=61111 status of remote agent in the system and active calls and queue -###################### - -if ($ADD==61111) -{ - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'" . mysql_real_escape_string($nextuser) . "',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - echo "VICIDIAL: Remote Agent Time On Calls $NOW_TIME\n\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo "| STATION | USER | LEADID | CHANNEL | STATUS | START TIME | MINUTES |\n"; - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select extension,user,lead_id,channel,status,last_call_time,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish) from vicidial_live_agents where status NOT IN('PAUSED') and server_ip='" . mysql_real_escape_string($server_ip) . "' and user IN($users_list) order by extension;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $leadlink=0; - $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) - { - $row[3]=''; - $row[5]=' - WAITING - '; - $row[6]=$row[7]; - } - $extension = sprintf("%-10s", $row[0]); - $user = sprintf("%-6s", $row[1]); - $leadid = sprintf("%-12s", $row[2]); - if ($row[2] > 0) - { - $leadidLINK=$row[2]; - $leadlink++; - if ( eregi("QUEUE",$row[4]) ) {$row[6]=$STARTtime;} - $leadid = "$leadid"; - } - $channel = sprintf("%-10s", $row[3]); - $cc=0; - while ( (strlen($channel) > 10) and ($cc < 100) ) - { - $channel = eregi_replace(".$","",$channel); - $cc++; - if (strlen($channel) <= 10) {$cc=101;} - } - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = ($STARTtime - $row[6]); - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - if ($call_time_M_int >= 5) {$G=''; $EG='';} - if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$extension$EG | $G$user$EG | $G$leadid$EG | $G$channel$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+------------|--------+--------------+------------+--------+---------------------+---------+\n"; - echo " $i 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 "********************************* NO AGENTS ON CALLS *********************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - -###################### -# ADD=71111 stats for remote agents from closer logs(vicidial_closer_log) -###################### - -if ($ADD==71111) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n\n"; - echo "
";
-
-	 if ( (strlen($server_ip) < 2) or (strlen($user) < 2) )
-		{echo "
REMOTE AGENTS ERROR - Please go back and look at the data you entered\n";} - else - { - - $users_list = ''; - $k=0; - while($k < $number_of_lines) - { - $nextuser=($user + $k); - $users_list .= "'$nextuser',"; - $k++; - } - $users_list = preg_replace("/.$/","",$users_list); - - $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list);"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $in_calls = $row[0]; - $in_time = $row[1]; - $in_time_M = ($in_time / 60); - $in_time_M = round($in_time_M, 2); - $in_time_M_int = intval("$in_time_M"); - $in_time_SEC = ($in_time_M - $in_time_M_int); - $in_time_SEC = ($in_time_SEC * 60); - $in_time_SEC = round($in_time_SEC, 0); - if ($in_time_SEC < 10) {$in_time_SEC = "0$in_time_SEC";} - $in_time_MS = "$in_time_M_int:$in_time_SEC"; - $in_time_MS = sprintf("%7s", $in_time_MS); - - echo "VICIDIAL: Remote Agent inbound stats $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 "\n"; - echo "\n"; - echo "Call list for $query_date:\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - echo "| USER | LEADID | GROUP | PHONE NUM | STATUS | CALL TIME | MINUTES |\n"; - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - - - $stmt="select user,lead_id,campaign_id,phone_number,status,call_date,length_in_sec from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and user IN($users_list) order by call_date;"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $talking_to_print = mysql_num_rows($rslt); - if ($talking_to_print > 0) - { - $i=0; - while ($i < $talking_to_print) - { - $row=mysql_fetch_row($rslt); - $user = sprintf("%-8s", $row[0]); - $leadid = sprintf("%-10s", $row[1]); - $group = sprintf("%-14s", $row[2]); - $phone = sprintf("%-10s", $row[3]); - $status = sprintf("%-6s", $row[4]); - $start_time = sprintf("%-19s", $row[5]); - $call_time_S = $row[6]; - - $call_time_M = ($call_time_S / 60); - $call_time_M = round($call_time_M, 2); - $call_time_M_int = intval("$call_time_M"); - $call_time_SEC = ($call_time_M - $call_time_M_int); - $call_time_SEC = ($call_time_SEC * 60); - $call_time_SEC = round($call_time_SEC, 0); - if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} - $call_time_MS = "$call_time_M_int:$call_time_SEC"; - $call_time_MS = sprintf("%7s", $call_time_MS); - $G = ''; $EG = ''; - # if ($call_time_M_int >= 5) {$G=''; $EG='';} - # if ($call_time_M_int >= 10) {$G=''; $EG='';} - - echo "| $G$user$EG | $G$leadid$EG | $G$group$EG | $G$phone$EG | $G$status$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; - - $i++; - } - - echo "+----------+------------+----------------+------------+--------+---------------------+---------+\n"; - # echo " $i agents logged in on server $server_ip\n\n"; - - # echo " - 5 minutes or more on call\n"; - # echo " - Over 10 minutes on call\n"; - - } - else - { - echo "**************************************************************************************\n"; - echo "********************************* NO CALLS ON THIS DAY *******************************\n"; - echo "**************************************************************************************\n"; - } - } - -echo "
\n\n"; - -} - - - - - -$ENDtime = date("U"); - -$RUNtime = ($ENDtime - $STARTtime); - -echo "\n\n\n


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


\nscript runtime: $RUNtime seconds
"; - - -?> - - -
- - - - - - - - - diff --git a/LANG_www/vicidial_en/voice_lab.php b/LANG_www/vicidial_en/voice_lab.php deleted file mode 100644 index 2ce3a2a9..00000000 --- a/LANG_www/vicidial_en/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_en/vtiger_search.php b/LANG_www/vicidial_en/vtiger_search.php deleted file mode 100644 index 6eaaf1bf..00000000 --- a/LANG_www/vicidial_en/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_en/welcome.php b/LANG_www/vicidial_en/welcome.php deleted file mode 100644 index f0bad6d9..00000000 --- a/LANG_www/vicidial_en/welcome.php +++ /dev/null @@ -1,25 +0,0 @@ - LICENSE: GPLv2 -# - -echo "VICIDIAL Welcome\n"; -echo "\n"; -echo "\n"; -echo "




"; -echo ""; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "
Welcome
 
Agent Login
 
Administration
 
\n"; -echo "\n\n"; -echo "\n\n"; -echo "\n\n"; - -?> \ No newline at end of file diff --git a/translations/de_language.txt b/translations/de_language.txt index 27f9aa21..92b189c3 100644 --- a/translations/de_language.txt +++ b/translations/de_language.txt @@ -36,7 +36,7 @@ agc|htglobalize.php|1 "NOV"|"NOV"| "DEC"|"DEZ"| \./images/|../agc/images/| -BORDER|RAND| +BORDER|BORDER| VALUE=SUBMIT|VALUE=SUBMIT| TYPE=SUBMIT|TYPE=Submit| MAXLENGTH|maxlength| @@ -46,7 +46,7 @@ Spanish|Spanisch| French|Französisch| German|Deutsch| Italian|Italienisch| -agc_live_call_OFF.gif|agc_live_call_OFF_de.gif| +agc_live_call_OFF.gif|agc_live_call_OFF_de.jpg| agc_live_call_ON.gif|agc_live_call_ON_de.gif| vdc_XB_hotkeysactive.gif|vdc_XB_hotkeysactive_de.gif| vdc_XB_hotkeysactive_OFF.gif|vdc_XB_hotkeysactive_OFF_de.gif| diff --git a/translations/sk_language.txt b/translations/sk_language.txt index 51d921cc..875d598d 100644 --- a/translations/sk_language.txt +++ b/translations/sk_language.txt @@ -336,8 +336,8 @@ PARK|ZAPARKOVAŤ| IN-NUMBER|V-ČÍSLE| NUMBER|ČÍSLO| LENGTH|DĹŽKA| -CALLERID|ID VOLAJÚCEHO| -CallerID|ID volajúceho| +CALLERID|IDVOLAJÚCEHO| +CallerID|IDvolajúceho| CALL| HOVOR| PICKUP|PREVZIAŤ| CONFERENCE|KONFERENCIA| diff --git a/www/vicidial/welcome_demo.php b/www/vicidial/welcome_demo.php new file mode 100644 index 00000000..64aedcb3 --- /dev/null +++ b/www/vicidial/welcome_demo.php @@ -0,0 +1,76 @@ + 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 "
"; +echo "   English Administration"; +echo "
"; +echo "   Spanish Administration"; +echo "
"; +echo "   German Administration"; +echo "
"; +echo "   Italian Administration"; +echo "
"; +echo "   Greek Administration"; +echo "
\n"; +echo "
 
\n"; +echo "\n\n"; +echo "\n\n"; +echo "\n\n"; + +?> \ No newline at end of file