/* Decoded by unphp.net */ 1 and strlen($groups[0]) < 1) { $groups[0] = $group; $RR = 1; } else { $group = $groups[0]; } goto Sm7Bt; tm1xh: if (!isset($CUSTINFOdisplay)) { $CUSTINFOdisplay = 0; } goto aUoaU; LqDtW: $LOGdelete_campaigns = $row[11]; goto hWHL_; jFId3: $LOGadmin_viewable_groupsSQL = ''; goto SU_YG; Jn7iB: if (!isset($PHONEdisplay)) { $PHONEdisplay = 0; } goto ptsap; EsuCp: $LOGdelete_call_times = $row[32]; goto nSwAQ; Jhcos: $qm_conf_ct = mysqli_num_rows($rslt); goto oe29M; fBDyB: $LOGuser_group = $row[5]; goto UGSnY; gjdJH: $rt_report_times["paused_medium_time"] = 60; goto BjwA_; bvLgr: $load_ave = get_server_load(true); goto q7yf2; BnnVt: $usergroup = preg_replace("/[^-_0-9a-zA-Z]/", '', $usergroup); goto rmSmI; ZR3je: $row = mysqli_fetch_row($rslt); goto HiXXe; VJxs0: $LOGmodify_phones = $row[73]; goto NGlzW; SU_YG: $valLOGadmin_viewable_groupsSQL = ''; goto jRkvj; U9nkn: $LOGmodify_statuses = $row[76]; goto ne7FA; iE58L: $LOGmodify_audiostore = $row[78]; goto c2lkP; HiXXe: $monitor_phone = $row[0]; goto CgbaV; MixOJ: $LOGdelete_dids = $row[57]; goto DiIIt; CgbaV: $stmt = "SELECT realtime_block_user_info,user_group,admin_hide_lead_data,admin_hide_phone_data from vicidial_users where user='{$PHP_AUTH_USER}';"; goto NPjmN; ku10C: $rt_report_times["waiting_long_time"] = 300; goto VGB4_; ZfxD3: $LOGdelete_scripts = $row[18]; goto OR6TI; Rs51j: $rslt = mysql_to_mysqli($stmt, $link); goto RShFS; RmZb6: session_start(); goto XOYwM; Thx1Q: $timeONEminuteAGO = date("Y-m-d H:i:s", $epochONEminuteAGO); goto A4HUc; H2usg: if ($CUSTPHONEdisplay == 1) { $CUSTINFOdisplay = 0; } goto Jiq_M; cib6J: if (!isset($CALLSdisplay)) { $CALLSdisplay = 1; } goto Jn7iB; ne7FA: $LOGmodify_voicemail = $row[77]; goto iE58L; uNSiY: $admin_auth = 0; goto MQft_; bekmF: if (strlen($slave_db_server) > 5 and preg_match("/{$report_name}/", $reports_use_slave_db)) { mysqli_close($link); $use_slave_server = 1; $db_source = "S"; require "dbconnect_mysqli.php"; } goto Ndf2X; Jiq_M: if (!isset($PAUSEcodes)) { $PAUSEcodes = "N"; } goto gmU51; Q2XZ5: $LOGforce_change_password = $row[71]; goto ymgL8; ohCyt: require "functions.php"; goto RXb1q; o5xjL: if ($CUSTINFOdisplay == 1) { $CUSTPHONEdisplay = 0; } goto sL3zg; SFUG6: $LOGdelete_remote_agents = $row[13]; goto y2Weu; loa6k: $LOGcallcard_admin = $row[70]; goto Q2XZ5; KD01q: $rt_report_times["paused_short_time"] = 10; goto gjdJH; sL3zg: if ($CUSTPHONEdisplay == 1) { $CUSTINFOdisplay = 0; } goto lqbIo; BRVmS: $LOGadmin_viewable_call_times = $row[3]; goto jFId3; UVocE: $NOW_HOUR = date("H:i:s"); goto JVJCV; NGlzW: $LOGmodify_carriers = $row[74]; goto sNw2G; JxgLk: $rt_report_times["paused_long_time10"] = 600; goto f4dII; hnODT: if (!isset($user_group_filter)) { $user_group_filter = array(); } goto Tw2mQ; RZX4j: $allow_usergroup = "1=1"; goto au4LP; ymgL8: $LOGmodify_shifts = $row[72]; goto VJxs0; qGrtZ: $RR = preg_replace("/[^0-9]/", '', $RR); goto VRXRP; h5i5B: $LOGallowed_reports = "{$row["1"]}|{$row["2"]}"; goto MRgsz; uy_wz: $LOGadmin_viewable_groups = $row[2]; goto BRVmS; HdQPo: $NOW_DAY = date("Y-m-d"); goto UVocE; VGB4_: $rt_report_times["incall_short_time"] = 10; goto b_P72; oe29M: if ($qm_conf_ct > 0) { $row = mysqli_fetch_row($rslt); $outbound_autodial_active = $row[1]; $slave_db_server = $row[2]; $reports_use_slave_db = $row[3]; $allow_chats = $row[7]; $cache_carrier_stats_realtime = $row[8]; $SSofcom_uk_drop_calc = $row[10]; $SSenable_pause_code_limits = $row[11]; $SStimeclock_end_of_day = $row[12]; $SSallow_web_debug = $row[13]; } goto JOwoQ; zMQla: $kk = 0; goto nUcA0; ylQNv: $allactivecampaigns .= "''"; goto zMQla; hWHL_: $LOGdelete_ingroups = $row[12]; goto SFUG6; TptnY: if (!isset($orderby)) { $orderby = "userA"; } goto TZ8ry; YEoyp: if ($auth_message == "GOOD" or $auth_message == "2FA") { $auth = 1; if ($auth_message == "2FA") { header("Content-type: text/html; charset=utf-8"); echo _QXZ("Your session is expired") . ". " . _QXZ("Click here to log in") . ".\xa"; die; } } goto BrERS; KnSRu: $LOGallowed_campaignsSQL = ''; goto EbJSM; xW0iy: $LOGdelete_from_dnc = $row[65]; goto loa6k; XOYwM: require "dbconnect_mysqli.php"; goto ohCyt; Ujz7P: $stmt = "SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_id != 'pixis' and active='Y' {$LOGallowed_campaignsSQL} and {$allow_usergroup} order by order_cam asc;"; goto lNp_D; Vw_du: $timeFIFTEENminutesAGO = date("Y-m-d H:i:s", $epochFIFTEENminutesAGO); goto LlWFf; GqHXt: $timeSIXhoursAGO = date("Y-m-d H:i:s", $epochSIXhoursAGO); goto U4ls2; aUoaU: if ($CUSTINFOdisplay == 1) { $CUSTPHONEdisplay = 0; } goto H2usg; Sm7Bt: function get_server_load($windows = false) { $os = strtolower(PHP_OS); if (strpos($os, "win") === false) { if (file_exists("/proc/loadavg")) { $load = file_get_contents("/proc/loadavg"); $load = explode(" ", $load); return $load[0] . " " . $load[1] . " " . $load[2]; } elseif (function_exists("shell_exec")) { $load = explode(" ", `uptime`); return $load[count($load) - 3] . " " . $load[count($load) - 2] . " " . $load[count($load) - 1]; } else { return false; } } elseif ($windows) { if (class_exists("COM")) { $wmi = new COM("WinMgmts:\\."); $cpus = $wmi->InstancesOf("Win32_Processor"); $cpuload = 0; $i = 0; while ($cpu = $cpus->Next()) { $cpuload += $cpu->LoadPercentage; $i++; } $cpuload = round(MathZDC($cpuload, $i), 2); return "{$cpuload}%"; } else { return false; } } } goto bvLgr; Q7o3X: $LOGast_delete_phones = $row[17]; goto ZfxD3; Mypz7: $row = mysqli_fetch_row($rslt); goto kh709; nSwAQ: $LOGmodify_call_times = $row[33]; goto ZFGKl; U4ls2: $epochTWENTYFOURhoursAGO = $STARTtime - 86400; goto c7Kgq; uUnQX: $profil = "admin"; goto RZX4j; DTxB_: $LOGfull_name = $row[3]; goto EaIJ1; TkbWX: $LOGview_reports = $row[43]; goto Qd7RM; bleKD: $realtime_block_user_info = $row[0]; goto H51Oo; btWXt: $epochFIFTEENminutesAGO = $STARTtime - 900; goto Vw_du; kh709: $LOGallowed_campaigns = $row[0]; goto LOUUC; i1RIx: $row = mysqli_fetch_row($rslt); goto vpDWj; rFHsX: $LOGmodify_ingroups = $row[39]; goto yMet5; kYtFP: $UGdisplay = preg_replace("/[^-_0-9a-zA-Z]/", '', $UGdisplay); goto C6ceK; A4HUc: $epochFIVEminutesAGO = $STARTtime - 300; goto bFmO6; HjTe5: if (!isset($UGdisplay)) { $UGdisplay = 0; } goto cWjbn; rz01g: $LOGcampaign_detail = $row[15]; goto TiZFt; wQPBL: $rowPr = mysqli_fetch_assoc($rsltPr); goto uUnQX; bzUiI: $LOGalter_agent_interface = $row[30]; goto EsuCp; CaoWw: $container_rslt = mysql_to_mysqli($container_stmt, $link); goto TRUm8; o2Rzj: if (!preg_match("/\-\-ALL\-\-/i", $LOGadmin_viewable_groups) and strlen($LOGadmin_viewable_groups) > 3) { $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/", '', $LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /", "','", $rawLOGadmin_viewable_groupsSQL); $LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','{$rawLOGadmin_viewable_groupsSQL}')"; $whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','{$rawLOGadmin_viewable_groupsSQL}')"; $valLOGadmin_viewable_groupsSQL = "and val.user_group IN('---ALL---','{$rawLOGadmin_viewable_groupsSQL}')"; $vmLOGadmin_viewable_groupsSQL = "and vm.user_group IN('---ALL---','{$rawLOGadmin_viewable_groupsSQL}')"; } else { $admin_viewable_groupsALL = 1; } goto ETsxQ; msAwU: $db_source = "M"; goto y2LRO; RIMzA: $reports_auth = 0; goto uNSiY; xS5Bw: $LOGmodify_servers = $row[42]; goto TkbWX; xXGf6: $rt_report_times["incall_long_time"] = 300; goto KD01q; G1hpD: $rslt = mysql_to_mysqli($stmt, $link); goto Jhcos; TZ8ry: if (!isset($SERVdisplay)) { $SERVdisplay = 0; } goto cib6J; qdB9t: $LOGadmin_hide_lead_data = $row[2]; goto joV7a; EbJSM: $whereLOGallowed_campaignsSQL = ''; goto G_c08; c7Kgq: $timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s", $epochTWENTYFOURhoursAGO); goto QVGnT; H9vcf: if (!isset($RR)) { $RR = 1; } goto aIv9G; EaIJ1: $LOGuser_level = $row[4]; goto fBDyB; AcVcO: $LOGmodify_contacts = $row[81]; goto ZQhvi; SjSzc: $i++; goto j4uQp; G_c08: if (!preg_match("/ALL-/", $LOGallowed_campaigns)) { $rawLOGallowed_campaignsSQL = preg_replace("/ -/", '', $LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ /", "','", $rawLOGallowed_campaignsSQL); $LOGallowed_campaignsSQL = "and campaign_id IN('{$rawLOGallowed_campaignsSQL}')"; $whereLOGallowed_campaignsSQL = "where campaign_id IN('{$rawLOGallowed_campaignsSQL}')"; } goto vgDEL; NPjmN: $rslt = mysql_to_mysqli($stmt, $link); goto xldUO; Im32u: $LISTgroups = array(); goto j3Axv; Uth1C: $timeONEhourAGO = date("Y-m-d H:i:s", $epochONEhourAGO); goto nhesB; DiIIt: $LOGmanager_shift_enforcement_override = $row[61]; goto jN3IZ; n50ET: $LOGmodify_tts = $row[80]; goto AcVcO; c2lkP: $LOGmodify_moh = $row[79]; goto n50ET; b_P72: $rt_report_times["incall_medium_time"] = 60; goto xXGf6; KEMSE: $stmt = "SELECT allowed_campaigns,allowed_reports,allowed_custom_reports from vicidial_user_groups where user_group='{$LOGuser_group}';"; goto IMEPW; OYnR2: $auth = 0; goto RIMzA; FLaxT: $rslt = mysql_to_mysqli($stmt, $link); goto Mypz7; C6ceK: $UidORname = preg_replace("/[^-_0-9a-zA-Z]/", '', $UidORname); goto AtABl; EqMB6: $i = 0; goto Im32u; JuUhe: $RS_DIDdesc = 0; goto TFYEv; EtaoE: while ($kk < count($ay_groupes)) { $groups = array(); $groups[0] = $ay_groupes[$kk]; $i = 0; $group_string = "|"; $group_ct = count($groups); while ($i < $group_ct) { $groups[$i] = preg_replace("/'|"|\\|;/", '', $groups[$i]); if (preg_match("/ {$groups[$i]} /", $regexLOGallowed_campaigns) or preg_match("/ALL-/", $LOGallowed_campaigns)) { $group_string .= "{$groups[$i]}|"; $group_SQL = "'{$groups[$i]}',"; $groupQS = "&groups[]={$groups[$i]}"; } $i++; } $group_SQL = preg_replace("/,$/i", '', $group_SQL); $i = 0; $user_group_string = "|"; $user_group_ct = count($user_group_filter); while ($i < $user_group_ct) { $user_group_filter[$i] = preg_replace("/'|"|\\|;/", '', $user_group_filter[$i]); $user_group_string .= "{$user_group_filter[$i]}|"; $user_group_SQL .= "'{$user_group_filter[$i]}',"; $usergroupQS .= "&user_group_filter[]={$user_group_filter[$i]}"; $i++; } $user_group_SQL = preg_replace("/,$/i", '', $user_group_SQL); $i = 0; $ingroup_string = "|"; $ingroup_ct = count($ingroup_filter); while ($i < $ingroup_ct) { $ingroup_filter[$i] = preg_replace("/[^-_0-9a-zA-Z]/", '', $ingroup_filter[$i]); $ingroup_string .= "{$ingroup_filter[$i]}|"; $ingroup_SQL .= "'{$ingroup_filter[$i]}',"; $ingroupQS .= "&ingroup_filter[]={$ingroup_filter[$i]}"; $i++; } $ingroup_SQL = preg_replace("/,$/i", '', $ingroup_SQL); if ($group_ct < 1 or strlen($group_string) < 2) { $groups[0] = "ALL-ACTIVE"; $group_string = "|ALL-ACTIVE|"; $group = "ALL-ACTIVE"; $groupQS .= "&groups[]=ALL-ACTIVE"; } if ($user_group_ct < 1 or strlen($user_group_string) < 2) { $user_group_filter[0] = "ALL-GROUPS"; $user_group_string = "|ALL-GROUPS|"; $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; } $ingroup_none = 0; if ($ingroup_ct < 1 or strlen($ingroup_string) < 2) { $ingroup_filter[0] = "ALL-INGROUPS"; $ingroup_string = "|ALL-INGROUPS|"; $ingroupQS .= "&ingroup_filter[]=ALL-INGROUPS"; $ingroup_none = 1; } if (preg_match("/\s\-\-NONE\-\-\s/", $group_string) or $group_ct < 1) { $all_active = 0; $group_SQL = "''"; $group_SQLand = "and FALSE"; $group_SQLwhere = "where FALSE"; } elseif (preg_match("/ALL\-ACTIVE/i", $group_string)) { $all_active = 1; $group_SQL = $allactivecampaigns; $group_SQLand = "and campaign_id IN({$allactivecampaigns})"; $group_SQLwhere = "where campaign_id IN({$allactivecampaigns})"; } else { $all_active = 0; $group_SQLand = "and campaign_id IN({$group_SQL})"; $group_SQLwhere = "where campaign_id IN({$group_SQL})"; } if (preg_match("/\s\-\-NONE\-\-\s/", $user_group_string) or $user_group_ct < 1) { $all_active_groups = 0; $user_group_SQL = "''"; } elseif (preg_match("/ALL\-GROUPS/i", $user_group_string)) { $all_active_groups = 1; $user_group_SQL = "'{$rawLOGadmin_viewable_groupsSQL}'"; } else { $all_active_groups = 0; } if (preg_match("/\s\-\-NONE\-\-\s/", $ingroup_string) or $ingroup_ct < 1) { $all_active_ingroups = 0; $ingroup_SQL = "''"; } elseif (preg_match("/ALL\-INGROUPS/i", $ingroup_string)) { $all_active_ingroups = 1; $ingroup_SQL = "'{$rawLOGadmin_viewable_groupsSQL}'"; $ingroup_SQLand = "and campaign_id IN({$rawLOGadmin_viewable_groupsSQL})"; $ingroup_SQLwhere = "where campaign_id IN({$rawLOGadmin_viewable_groupsSQL})"; } else { $all_active_ingroups = 0; } $stmt = "SELECT user_group from vicidial_user_groups {$whereLOGadmin_viewable_groupsSQL} order by user_group;"; $rslt = mysql_to_mysqli($stmt, $link); $usergroups_to_print = mysqli_num_rows($rslt); $i = 0; $usergroups = array(); $usergroupnames = array(); $usergroups[$i] = "ALL-GROUPS"; $usergroupnames[$i] = "All user groups"; $i++; $usergroups_to_print++; while ($i < $usergroups_to_print) { $row = mysqli_fetch_row($rslt); $usergroups[$i] = $row[0]; $i++; } $stmt = "select group_id,group_name from vicidial_inbound_groups {$whereLOGadmin_viewable_groupsSQL} order by group_id;"; $rslt = mysql_to_mysqli($stmt, $link); $ingroups_to_print = mysqli_num_rows($rslt); $i = 0; $LISTingroups = array(); $LISTingroup_names = array(); $LISTingroups[$i] = "ALL-INGROUPS"; $i++; $ingroups_to_print++; $ingroups_string = "|"; while ($i < $ingroups_to_print) { $row = mysqli_fetch_row($rslt); $LISTingroups[$i] = $row[0]; $LISTingroup_names[$i] = $row[1]; $ingroups_string .= "{$LISTingroups[$i]}|"; $i++; } if (isset($RS_CUSTINFOminUL)) { $CUSTINFOminUL = $RS_CUSTINFOminUL; } else { $CUSTINFOminUL = 9; } if ($LOGuser_level < $CUSTINFOminUL) { $CUSTINFOdisplay = 0; } $stmt = "SELECT count(*) from vicidial_campaigns where campaign_id != 'pixis' and active='Y' and campaign_allow_inbound='Y' {$group_SQLand};"; $rslt = mysql_to_mysqli($stmt, $link); $row = mysqli_fetch_row($rslt); $campaign_allow_inbound = $row[0]; if ($group) { $multi_drop = 0; $stmt = "SELECT group_id from vicidial_inbound_groups;"; $rslt = mysql_to_mysqli($stmt, $link); $ingroups_to_print = mysqli_num_rows($rslt); $c = 0; while ($ingroups_to_print > $c) { $row = mysqli_fetch_row($rslt); $ALLcloser_campaignsSQL .= "'{$row["0"]}',"; $c++; } $ALLcloser_campaignsSQL = preg_replace("/,$/", '', $ALLcloser_campaignsSQL); if (strlen($ALLcloser_campaignsSQL) < 2) { $ALLcloser_campaignsSQL = "''"; } if ($DB > 0) { echo " |{$ALLcloser_campaignsSQL}|{$stmt}| "; } if ((preg_match("/Y/", $with_inbound) or preg_match("/O/", $with_inbound)) and $campaign_allow_inbound > 0) { $closer_campaignsSQL = ''; $stmt = "SELECT closer_campaigns from vicidial_campaigns where campaign_id != 'pixis' and active='Y' {$group_SQLand};"; $rslt = mysql_to_mysqli($stmt, $link); $ccamps_to_print = mysqli_num_rows($rslt); $c = 0; while ($ccamps_to_print > $c) { $row = mysqli_fetch_row($rslt); $closer_campaigns = $row[0]; $closer_campaigns_STRING = preg_replace("/^ | -$/", '', $closer_campaigns); $closer_campaigns = preg_replace("/ /", "','", $closer_campaigns_STRING); $closer_campaignsSQL .= "'{$closer_campaigns}',"; $c++; } $filter_closer_campaigns_STRING = ''; if (!in_array("ALL-INGROUPS", $ingroup_filter)) { $filter_closer_campaigns = ''; for ($q = 0; $q < count($ingroup_filter); $q++) { if (preg_match("/\'{$ingroup_filter[$q]}\'/", $closer_campaignsSQL)) { $filter_closer_campaigns .= "'{$ingroup_filter[$q]}',"; if ($q < 1) { $filter_closer_campaigns_STRING .= " "; } $filter_closer_campaigns_STRING .= "{$ingroup_filter[$q]} "; } } $closer_campaignsSQL = $filter_closer_campaigns; } $closer_campaignsSQL = preg_replace("/,$/", '', $closer_campaignsSQL); } if (strlen($closer_campaignsSQL) < 2) { $closer_campaignsSQL = "''"; } $answersSQL = "sum(answers_today)"; $answers_singleSQL = "answers_today"; $answers_text = _QXZ("ANSWERED"); $ALLINGROUPstats = 1; if ($ALLINGROUPstats > 0 or preg_match("/O/", $with_inbound)) { $stmtB = "SELECT campaign_id from vicidial_campaign_stats where campaign_id IN ({$closer_campaignsSQL}) order by campaign_id;"; $r = 0; $rslt = mysql_to_mysqli($stmtB, $link); $ingroups_to_print = mysqli_num_rows($rslt); while ($ingroups_to_print > $r) { $row = mysqli_fetch_row($rslt); $ARYingroupdetail[$r] = $row[0]; $r++; } $r = 0; $drpctTODAYPP = 0; $dropsTODAYPP = 0; $answersTODAY = 0; while ($ingroups_to_print > $r) { $stmtB = "SELECT calls_today,drops_today,{$answers_singleSQL},status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id='{$ARYingroupdetail[$r]}';"; $rslt = mysql_to_mysqli($stmtB, $link); $ingroup_to_print = mysqli_num_rows($rslt); if ($ingroup_to_print > 0) { $row = mysqli_fetch_row($rslt); $callsTODAY = $row[0]; $dropsTODAY = $row[1]; $answersTODAY = $row[2]; $VSCcat1 = $row[3]; $VSCcat1tally = $row[4]; $VSCcat2 = $row[5]; $VSCcat2tally = $row[6]; $VSCcat3 = $row[7]; $VSCcat3tally = $row[8]; $VSCcat4 = $row[9]; $VSCcat4tally = $row[10]; $hold_sec_stat_one = $row[11]; $hold_sec_stat_two = $row[12]; $hold_sec_answer_calls = $row[13]; $hold_sec_drop_calls = $row[14]; $hold_sec_queue_calls = $row[15]; $ingroupdetail = $row[16]; } $drpctTODAY = MathZDC($dropsTODAY, $answersTODAY) * 100; $drpctTODAY = round($drpctTODAY, 2); $drpctTODAY = sprintf("%01.2f", $drpctTODAY); $AVGhold_sec_queue_calls = MathZDC($hold_sec_queue_calls, $callsTODAY); $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); $AVGhold_sec_drop_calls = MathZDC($hold_sec_drop_calls, $dropsTODAY); $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); $PCThold_sec_stat_one = MathZDC($hold_sec_stat_one, $answersTODAY) * 100; $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); $PCThold_sec_stat_two = MathZDC($hold_sec_stat_two, $answersTODAY) * 100; $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); $AVGhold_sec_answer_calls = MathZDC($hold_sec_answer_calls, $answersTODAY); $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); $AVG_ANSWERagent_non_pause_sec = MathZDC($answersTODAY, 0) * 60; $AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2); $AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec); $Dicbq_stmt = "SELECT count(*) from vicidial_inbound_callback_queue where icbq_status='LIVE' and group_id='{$ARYingroupdetail[$r]}';"; $Dicbq_rslt = mysql_to_mysqli($Dicbq_stmt, $link); $Dicbq_ct = mysqli_num_rows($Dicbq_rslt); $Dicbq_live = 0; if ($Dicbq_ct > 0) { $Dicbq_ARY = mysqli_fetch_row($Dicbq_rslt); if ($Dicbq_ARY[0] > 0) { $Dicbq_live = $Dicbq_ARY[0]; } } $drpctTODAYPP += $drpctTODAY; $dropsTODAYPP += $dropsTODAY; $answersTODAYPP += $answersTODAY; $r++; } if ($ingroups_to_print > 0) { $callsTODAY = $dropsTODAYPP + $answersTODAYPP; if ($callsTODAY > 0) { $traiteP = floor($answersTODAYPP * 100 / $callsTODAY); $drpctTODAYPP = 100 - $traiteP; } else { $traiteP = 0; $drpctTODAYPP = 0; } $ingroup_detail = "
\xa
Trafic entrant
\xa
\xa
\xa
\xa Appels re\xc3\xa7us\xa
" . $callsTODAY . "
\xa
\xa\xa
\xa Appels trait\xc3\xa9s (" . $answersTODAYPP . ")\xa
" . $traiteP . "%
\xa
\xa
Abandons (" . floor($dropsTODAYPP) . ")\xa
" . $drpctTODAYPP . "%
\xa
"; } } } if (preg_match("/ALL\-ACTIVE/i", $group_string)) { $non_inboundSQL = ''; if (preg_match("/N/", $with_inbound)) { $non_inboundSQL = "and campaign_id NOT IN({$ALLcloser_campaignsSQL})"; } else { $non_inboundSQL = "and campaign_id IN({$group_SQL},{$closer_campaignsSQL})"; } $multi_drop++; $stmt = "SELECT avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level),max(ofcom_uk_drop_calc) from vicidial_campaigns WHERE campaign_id != 'pixis' and active='Y' {$group_SQLand};"; $stmtB = "SELECT sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),{$answersSQL},max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today),sum(agenthandled_today),sum(park_calls_today),sum(park_sec_today) from vicidial_campaign_stats where calls_today > -1 {$non_inboundSQL};"; $stmtC = "SELECT count(*) from vicidial_campaigns WHERE campaign_id != 'pixis' and agent_pause_codes_active!='N' and active='Y' {$group_SQLand};"; } else { if (preg_match("/Y/", $with_inbound) and $campaign_allow_inbound > 0) { $multi_drop++; $stmt = "SELECT auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix,auto_hopper_level,ofcom_uk_drop_calc from vicidial_campaigns WHERE campaign_id != 'pixis' and campaign_id IN ({$group_SQL},{$closer_campaignsSQL});"; $stmtB = "SELECT sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),{$answersSQL},max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today),sum(agenthandled_today),sum(park_calls_today),sum(park_sec_today) from vicidial_campaign_stats where campaign_id IN ({$group_SQL},{$closer_campaignsSQL});"; $stmtC = "SELECT count(*) from vicidial_campaigns WHERE campaign_id != 'pixis' and agent_pause_codes_active!='N' and active='Y' and campaign_id IN ({$group_SQL},{$closer_campaignsSQL});"; } else { $stmt = "SELECT avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix),max(auto_hopper_level),max(ofcom_uk_drop_calc) from vicidial_campaigns WHERE campaign_id != 'pixis' and campaign_id IN({$group_SQL});"; $stmtB = "SELECT sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),{$answersSQL},max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today),sum(agenthandled_today),sum(park_calls_today),sum(park_sec_today) from vicidial_campaign_stats where campaign_id IN({$group_SQL});"; $stmtC = "SELECT count(*) from vicidial_campaigns WHERE campaign_id != 'pixis' and agent_pause_codes_active!='N' and active='Y' and campaign_id IN(".$group_SQL.")"; } } $rslt = mysql_to_mysqli($stmt, $link); $row = mysqli_fetch_row($rslt); $DIALlev = 12; $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]; $DIALmix = $row[20]; $AHOPlev = $row[21]; $UKocDROP = $row[22]; $rslt = mysql_to_mysqli($stmtC, $link); $row = mysqli_fetch_row($rslt); $agent_pause_codes_active = $row[0]; $stmt = "SELECT count(*) from vicidial_hopper {$group_SQLwhere};"; $rslt = mysql_to_mysqli($stmt, $link); $row = mysqli_fetch_row($rslt); $VDhop = $row[0]; $rslt = mysql_to_mysqli($stmtB, $link); $row = mysqli_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]; $VSCagentcalls = $row[16]; $VSCagentwait = $row[17]; $VSCagentcust = $row[18]; $VSCagentacw = $row[19]; $VSCagentpause = $row[20]; $AGNTansTODAY = $row[21]; $PARKcallTODAY = $row[22]; $PARKsecTODAY = $row[23]; if ($multi_drop > 0) { if ($SSofcom_uk_drop_calc > 0 and $UKocDROP == "Y") { $temp_AGNTansPLUSdrop = $AGNTansTODAY + $dropsTODAY; $drpctTODAY = MathZDC($dropsTODAY, $temp_AGNTansPLUSdrop) * 100; $drpctTODAY = round($drpctTODAY, 2); $drpctTODAY = sprintf("%01.2f", $drpctTODAY); } else { $drpctTODAY = MathZDC($dropsTODAY, $answersTODAY) * 100; $drpctTODAY = round($drpctTODAY, 2); $drpctTODAY = sprintf("%01.2f", $drpctTODAY); } } $diffpctONEMIN = MathZDC($diffONEMIN, $agentsONEMIN) * 100; $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); $stmt = "SELECT sum(local_trunk_shortage) from vicidial_campaign_server_stats {$group_SQLwhere};"; $rslt = mysql_to_mysqli($stmt, $link); $row = mysqli_fetch_row($rslt); $balanceSHORT = $row[0]; if (preg_match("/DISABLED/", $DIALmix)) { $DIALstatuses = preg_replace("/ -$|^ /", '', $DIALstatuses); $DIALstatuses = preg_replace("/\s/", ", ", $DIALstatuses); } else { $stmt = "SELECT vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' {$group_SQLand} limit 1;"; $rslt = mysql_to_mysqli($stmt, $link); $Lmix_to_print = mysqli_num_rows($rslt); if ($Lmix_to_print > 0) { $row = mysqli_fetch_row($rslt); $DIALstatuses = _QXZ("List Mix") . ": {$row["0"]}"; $DIALorder = _QXZ("List Mix") . ": {$row["0"]}"; } } $DIALlev =12; $agentsONEMIN = sprintf("%01.2f", $agentsONEMIN); $diffONEMIN = sprintf("%01.2f", $diffONEMIN); if ($campaign_allow_inbound > 0) { if (preg_match("/ALL\-ACTIVE/i", $group_string)) { $stmt = "SELECT closer_campaigns from vicidial_campaigns WHERE campaign_id != 'pixis' and active='Y' {$group_SQLand}"; $rslt = mysql_to_mysqli($stmt, $link); $closer_campaigns = ''; while ($row = mysqli_fetch_row($rslt)) { $closer_campaigns .= "{$row["0"]}"; } $closer_campaigns = preg_replace("/^ | -$/", '', $closer_campaigns); $closer_campaigns = preg_replace("/ - /", " ", $closer_campaigns); $closer_campaigns = preg_replace("/ /", "','", $closer_campaigns); $closer_campaignsSQL = "'{$closer_campaigns}'"; } if (!in_array("ALL-INGROUPS", $ingroup_filter)) { $filter_closer_campaigns = ''; for ($q = 0; $q < count($ingroup_filter); $q++) { if (preg_match("/\'{$ingroup_filter[$q]}\'/", $closer_campaignsSQL)) { $filter_closer_campaigns .= "'{$ingroup_filter[$q]}',"; } } $closer_campaignsSQL = $filter_closer_campaigns; } $closer_campaignsSQL = preg_replace("/,$/", '', $closer_campaignsSQL); $stmtB = "from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN({$closer_campaignsSQL})) or (call_type IN('OUT','OUTBALANCE') {$group_SQLand}) ) order by queue_priority desc,campaign_id,call_time;"; } else { $stmtB = "from vicidial_auto_calls where status NOT IN('XFER') {$group_SQLand} order by queue_priority desc,campaign_id,call_time;"; } if ($CALLSdisplay > 0) { $stmtA = "SELECT status,campaign_id,phone_number,server_ip,UNIX_TIMESTAMP(call_time),call_type,queue_priority,agent_only"; if ($allow_chats) { $chat_stmtA = "SELECT vlc.status,group_id as campaign_id,if(length(v.phone_number)=0 or v.phone_number is null, v.phone_number, '**NO PHONE**') as phone_number, '' as server_ip,UNIX_TIMESTAMP(chat_start_time), 'CHAT' as call_type, '' as queue_priority, '' as agent_only"; } } else { $stmtA = "SELECT status"; if ($allow_chats) { $chat_stmtA = "SELECT vlc.status"; } } $k = 0; $agentonlycount = 0; $out_total = 0; $out_ring = 0; $out_live = 0; $in_ivr = 0; $D_active_calls = 0; $CDstatus = array(); $CDcampaign_id = array(); $CDphone_number = array(); $CDserver_ip = array(); $CDcall_time = array(); $CDcall_type = array(); $CDqueue_priority = array(); $CDagent_only = array(); $stmt = "{$stmtA} {$stmtB}"; $rslt = mysql_to_mysqli($stmt, $link); $parked_to_print = mysqli_num_rows($rslt); if ($parked_to_print > 0) { $i = 0; $out_total = 0; $out_ring = 0; $out_live = 0; $in_ivr = 0; while ($i < $parked_to_print) { $row = mysqli_fetch_row($rslt); if ($LOGadmin_hide_phone_data != "0") { $phone_temp = $row[2]; if (strlen($phone_temp) > 0) { if ($LOGadmin_hide_phone_data == "4_DIGITS") { $row[2] = str_repeat("X", strlen($phone_temp) - 4) . substr($phone_temp, -4, 4); } elseif ($LOGadmin_hide_phone_data == "3_DIGITS") { $row[2] = str_repeat("X", strlen($phone_temp) - 3) . substr($phone_temp, -3, 3); } elseif ($LOGadmin_hide_phone_data == "2_DIGITS") { $row[2] = str_repeat("X", strlen($phone_temp) - 2) . substr($phone_temp, -2, 2); } else { $row[2] = preg_replace("/./", "X", $phone_temp); } } } if (preg_match("/LIVE/i", $row[0])) { $out_live++; if ($CALLSdisplay > 0) { $CDstatus[$k] = $row[0]; $CDcampaign_id[$k] = $row[1]; $CDphone_number[$k] = $row[2]; $CDserver_ip[$k] = $row[3]; $CDcall_time[$k] = $row[4]; $CDcall_type[$k] = $row[5]; $CDqueue_priority[$k] = $row[6]; $CDagent_only[$k] = $row[7]; if (strlen($CDagent_only[$k]) > 0) { $agentonlycount++; } $k++; } } else { if (preg_match("/IVR/i", $row[0])) { $in_ivr++; if ($CALLSdisplay > 0) { $CDstatus[$k] = $row[0]; $CDcampaign_id[$k] = $row[1]; $CDphone_number[$k] = $row[2]; $CDserver_ip[$k] = $row[3]; $CDcall_time[$k] = $row[4]; $CDcall_type[$k] = $row[5]; $CDqueue_priority[$k] = $row[6]; $CDagent_only[$k] = $row[7]; if (strlen($CDagent_only[$k]) > 0) { $agentonlycount++; } $k++; } } if (preg_match("/CLOSER/i", $row[0])) { $nothing = 1; } else { $out_ring++; } } $out_total++; $i++; } $D_active_calls = 1; } else { $D_active_calls = 0; } $D_active_chats = 0; $chats_waiting = 0; if ($allow_chats) { $chat_stmtB = " from vicidial_live_chats vlc, vicidial_list v where vlc.status='WAITING' and group_id IN({$closer_campaignsSQL}) and vlc.lead_id=v.lead_id "; $chat_stmt = "{$chat_stmtA} {$chat_stmtB}"; $chat_rslt = mysql_to_mysqli($chat_stmt, $link); $waiting_to_chat = mysqli_num_rows($chat_rslt); if ($waiting_to_chat > 0) { $i = 0; while ($i < $waiting_to_chat) { $chat_row = mysqli_fetch_row($chat_rslt); $chats_waiting++; if ($CALLSdisplay > 0) { $CDstatus[$k] = $chat_row[0]; $CDcampaign_id[$k] = $chat_row[1]; $CDphone_number[$k] = $chat_row[2]; $CDserver_ip[$k] = $chat_row[3]; $CDcall_time[$k] = $chat_row[4]; $CDcall_type[$k] = $chat_row[5]; $CDqueue_priority[$k] = $chat_row[6]; $CDagent_only[$k] = $chat_row[7]; if (strlen($CDagent_only[$k]) > 0) { $agentonlycount++; } $k++; } $i++; } $D_active_chats = 1; } else { $D_active_chats = 0; } } $icbq_stmt = "SELECT count(*) from vicidial_inbound_callback_queue where icbq_status='LIVE' and group_id IN({$closer_campaignsSQL});"; $icbq_rslt = mysql_to_mysqli($icbq_stmt, $link); $icbq_ct = mysqli_num_rows($icbq_rslt); if ($icbq_ct > 0) { $icbq_ARY = mysqli_fetch_row($icbq_rslt); $icbq_live = $icbq_ARY[0]; } $agent_incall = 0; $agent_indial = 0; $agent_ready = 0; $agent_paused = 0; $agent_dispo = 0; $agent_dead = 0; $agent_total = 0; if (isset($_POST["order"]) and $_POST["order"] != "undefined") { $orderby = $_POST["order"]; } else { $orderby = "SAyoub"; } $phoneord = $orderby; $userord = $orderby; $groupord = $orderby; $timeord = $orderby; $campaignord = $orderby; $statusord = $orderby; if ($phoneord == "phoneup") { $phoneord = "phonedown"; } else { $phoneord = "phoneup"; } if ($userord == "userup") { $userord = "userdown"; } else { $userord = "userup"; } if ($groupord == "groupup") { $groupord = "groupdown"; } else { $groupord = "groupup"; } if ($timeord == "timeup") { $timeord = "timedown"; } else { $timeord = "timeup"; } if ($campaignord == "campaignup") { $campaignord = "campaigndown"; } else { $campaignord = "campaignup"; } if ($statusord == "statusup") { $statusord = "statudown"; } else { $statusord = "statusup"; } $Aecho = "
"; $Aecho .= "\xa \xa \xa \xa \xa \xa "; if ($orderby == "SAyoub") { $orderSQL = "FIELD(vicidial_live_agents.status, "INCALL") DESC"; } if ($orderby == "statusup") { $orderSQL = "FIELD(vicidial_live_agents.status, "INCALL") ASC"; } if ($orderby == "statudown") { $orderSQL = "FIELD(vicidial_live_agents.status, "INCALL") DESC"; } if ($orderby == "userA") { $orderSQL = "user"; } if ($orderby == "timeup") { $orderSQL = "vicidial_live_agents.status,last_call_time"; } if ($orderby == "timedown") { $orderSQL = "vicidial_live_agents.status desc,last_call_time desc"; } if ($orderby == "campaignup") { $orderSQL = "vicidial_live_agents.campaign_id,vicidial_live_agents.status,last_call_time"; } if ($orderby == "campaigndown") { $orderSQL = "vicidial_live_agents.campaign_id desc,vicidial_live_agents.status desc,last_call_time desc"; } if ($orderby == "groupup") { $orderSQL = "user_group,vicidial_live_agents.status,last_call_time"; } if ($orderby == "groupdown") { $orderSQL = "user_group desc,vicidial_live_agents.status desc,last_call_time desc"; } if ($orderby == "phoneup") { $orderSQL = "extension,server_ip"; } if ($orderby == "phonedown") { $orderSQL = "extension desc,server_ip desc"; } if ($UidORname > 0) { if ($orderby == "userup") { $orderSQL = "full_name,status,last_call_time"; } if ($orderby == "userdown") { $orderSQL = "full_name desc,status desc,last_call_time desc"; } } else { if ($orderby == "userup") { $orderSQL = "vicidial_live_agents.user"; } if ($orderby == "userdown") { $orderSQL = "vicidial_live_agents.user desc"; } } if (!preg_match("/ALL-/", $LOGallowed_campaigns)) { $UgroupSQL = " and vicidial_live_agents.campaign_id IN({$group_SQL})"; } else { if (preg_match("/ALL\-ACTIVE/i", $group_string) and strlen($group_SQL) < 3) { $UgroupSQL = ''; } else { $UgroupSQL = " and vicidial_live_agents.campaign_id IN({$group_SQL})"; } } if (strlen($usergroup) < 1) { $usergroupSQL = ''; } else { $usergroupSQL = " and user_group='" . mysqli_real_escape_string($link, $usergroup) . "'"; } if (preg_match("/ALL\-GROUPS/i", $user_group_string) and strlen($user_group_SQL) < 3) { $user_group_filter_SQL = ''; } else { $user_group_filter_SQL = " and vicidial_users.user_group IN({$user_group_SQL})"; } $ring_agents = 0; $Aextension = array(); $Auser = array(); $Asessionid = array(); $Astatus = array(); $Aserver_ip = array(); $Acall_time = array(); $Acall_finish = array(); $Acall_server_ip = array(); $Acampaign_id = array(); $Auser_group = array(); $Afull_name = array(); $Acomments = array(); $Acalls_today = array(); $Acallerid = array(); $Alead_id = array(); $Astate_change = array(); $Aon_hook_agent = array(); $Aring_callerid = array(); $Aagent_log_id = array(); $Aring_note = array(); $VAClead_ids = array(); $VACphones = array(); if ($allow_usergroup != "1=1") { $allow_usergroup_sql = "and vicidial_users." . $allow_usergroup . ''; } else { $allow_usergroup_sql = ''; } $stmt = "SELECT extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id,vicidial_live_agents.closer_campaigns from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and vicidial_users.user_hide_realtime='0' {$allow_usergroup_sql} {$UgroupSQL} {$usergroupSQL} {$user_group_filter_SQL} order by {$orderSQL};"; $rslt = mysql_to_mysqli($stmt, $link); $talking_to_print = mysqli_num_rows($rslt); if ($talking_to_print > 0) { $i = 0; $va = 0; while ($i < $talking_to_print) { $row = mysqli_fetch_row($rslt); $ingroup_pass = 1; if (strlen($ingroup_string) > 1 and !preg_match("/ALL-INGROUPS/", $ingroup_string)) { $ingroup_pass = 0; $fcc_ct = 0; $fcc_array = explode(" ", $filter_closer_campaigns_STRING); $fcc_array_ct = count($fcc_array); if (strlen($row[19]) > 2) { while ($fcc_array_ct > $fcc_ct) { $temp_fcc = $fcc_array[$fcc_ct]; if (preg_match("/ {$temp_fcc} /", $row[19])) { $ingroup_pass++; } $fcc_ct++; } } } $ingroup_pass = 1; if ($ingroup_pass > 0) { $Aextension[$va] = $row[0]; $Auser[$va] = $row[1]; $Asessionid[$va] = $row[2]; $Astatus[$va] = $row[3]; $Aserver_ip[$va] = $row[4]; $Acall_time[$va] = $row[5]; $Acall_finish[$va] = $row[6]; $Acall_server_ip[$va] = $row[7]; $Acampaign_id[$va] = $row[8]; $Auser_group[$va] = $row[9]; $Afull_name[$va] = $row[10]; $Acomments[$va] = $row[11]; $Acalls_today[$va] = $row[12]; $Acallerid[$va] = $row[13]; $Alead_id[$va] = $row[14]; $Astate_change[$va] = $row[15]; $Aon_hook_agent[$va] = $row[16]; $Aring_callerid[$va] = $row[17]; $Aagent_log_id[$va] = $row[18]; $Acloser_campaigns[$va] = $row[19]; $Aring_note[$va] = " "; if ($Aon_hook_agent[$va] == "Y") { $Aring_note[$va] = "*"; $ring_agents++; if (strlen($Aring_callerid[$va]) > 18) { $Astatus[$va] = "RING"; } } if ($Alead_id[$va] != 0) { $threewaystmt = "SELECT UNIX_TIMESTAMP(last_call_time) from vicidial_live_agents where lead_id='{$Alead_id[$va]}' and status='INCALL' order by UNIX_TIMESTAMP(last_call_time) desc"; $threewayrslt = mysql_to_mysqli($threewaystmt, $link); if (mysqli_num_rows($threewayrslt) > 1) { $Astatus[$va] = "3-WAY"; $srow = mysqli_fetch_row($threewayrslt); $Acall_mostrecent[$va] = $srow[0]; } } $va++; } $i++; } $talking_to_print = $va; $callerids = ''; $pausecode = ''; $stmt = "SELECT callerid,lead_id,phone_number from vicidial_auto_calls;"; $rslt = mysql_to_mysqli($stmt, $link); $calls_to_list = mysqli_num_rows($rslt); if ($calls_to_list > 0) { $i = 0; while ($i < $calls_to_list) { $row = mysqli_fetch_row($rslt); if ($LOGadmin_hide_phone_data != "0") { $phone_temp = $row[2]; if (strlen($phone_temp) > 0) { if ($LOGadmin_hide_phone_data == "4_DIGITS") { $row[2] = str_repeat("X", strlen($phone_temp) - 4) . substr($phone_temp, -4, 4); } elseif ($LOGadmin_hide_phone_data == "3_DIGITS") { $row[2] = str_repeat("X", strlen($phone_temp) - 3) . substr($phone_temp, -3, 3); } elseif ($LOGadmin_hide_phone_data == "2_DIGITS") { $row[2] = str_repeat("X", strlen($phone_temp) - 2) . substr($phone_temp, -2, 2); } else { $row[2] = preg_replace("/./", "X", $phone_temp); } } } $callerids .= "{$row["0"]}|"; $VAClead_ids[$i] = $row[1]; $VACphones[$i] = $row[2]; $i++; } } $i = 0; while ($i < $talking_to_print) { if (preg_match("/R\//i", $Aextension[$i])) { $protocol = "EXTERNAL"; $dialplan = preg_replace("/R\//i", '', $Aextension[$i]); $dialplan = preg_replace("/\@.*/i", '', $dialplan); $exten = "dialplan_number='{$dialplan}'"; } if (preg_match("/Local\//i", $Aextension[$i])) { $protocol = "EXTERNAL"; $dialplan = preg_replace("/Local\//i", '', $Aextension[$i]); $dialplan = preg_replace("/\@.*/i", '', $dialplan); $exten = "dialplan_number='{$dialplan}'"; } if (preg_match("/SIP\//i", $Aextension[$i])) { $protocol = "SIP"; $dialplan = preg_replace("/SIP\//i", '', $Aextension[$i]); $dialplan = preg_replace("/\-.*/i", '', $dialplan); $exten = "extension='{$dialplan}'"; } if (preg_match("/IAX2\//i", $Aextension[$i])) { $protocol = "IAX2"; $dialplan = preg_replace("/IAX2\//i", '', $Aextension[$i]); $dialplan = preg_replace("/\-.*/i", '', $dialplan); $exten = "extension='{$dialplan}'"; } if (preg_match("/Zap\//i", $Aextension[$i])) { $protocol = "Zap"; $dialplan = preg_replace("/Zap\//i", '', $Aextension[$i]); $exten = "extension='{$dialplan}'"; } if (preg_match("/DAHDI\//i", $Aextension[$i])) { $protocol = "Zap"; $dialplan = preg_replace("/DAHDI\//i", '', $Aextension[$i]); $exten = "extension='{$dialplan}'"; } $stmt = "SELECT login from phones where server_ip='{$Aserver_ip[$i]}' and {$exten} and protocol='{$protocol}';"; $rslt = mysql_to_mysqli($stmt, $link); $phones_to_print = mysqli_num_rows($rslt); if ($phones_to_print > 0) { $row = mysqli_fetch_row($rslt); $Alogin[$i] = "{$row["0"]}-----{$i}"; } else { $Alogin[$i] = "{$Aextension[$i]}-----{$i}"; } $i++; } if ($orderby == "phoneup") { sort($Alogin); } if ($orderby == "phonedown") { rsort($Alogin); } $j = 0; $agentcount = 0; $total_ventes = 0; $attentes = array(); while ($j < $talking_to_print) { $n = 0; $custphone = ''; $cust_state = ''; $cust_entrydate = ''; $cust_source = ''; while ($n < $calls_to_list) { if (preg_match("/{$VAClead_ids[$n]}/", $Alead_id[$j]) and strlen($VAClead_ids[$n]) == strlen($Alead_id[$j]) and strlen($VAClead_ids[$n] > 1)) { $custphone = $VACphones[$n]; } $n++; } $phone_split = explode("-----", $Alogin[$j]); $i = $phone_split[1]; if (preg_match("/READY|PAUSED/i", $Astatus[$i])) { $Acall_time[$i] = $Astate_change[$i]; if ($Alead_id[$i] > 0) { $Astatus[$i] = "DISPO"; $Lstatus = "DISPO"; $status = " Qualification"; } } $extension = preg_replace("/Local\//i", '', $Aextension[$i]); $CUSTINFOdisplay = 1; $list_name = ''; if ($CUSTINFOdisplay > 0 && $Alead_id[$j] > 0) { $custinfo_stmt = "select * from vicidial_list where lead_id='" . $Alead_id[$j] . "' and phone_number='" . $custphone . "'"; $custinfo_rslt = mysql_to_mysqli($custinfo_stmt, $link); $CIrow = mysqli_fetch_array($custinfo_rslt); $cust_state = $CIrow["state"]; $cust_entrydate = $CIrow["entry_date"]; $list_id = $CIrow["list_id"]; $cust_source = substr($CIrow["source_id"], 0, 20); $lists_stmt = "select * from vicidial_lists where lead_id='" . $list_id . "'"; $lists_rslt = mysql_to_mysqli($lists_stmt, $link); $lirow = mysqli_fetch_array($lists_rslt); $list_name = $lirow["list_name"]; } $phone = sprintf("%-18s", $phone_split[0]); $custphone = sprintf("%-11s", $custphone); $cust_state = sprintf("%-5s", $cust_state); $cust_entrydate = sprintf("%-19s", $cust_entrydate); $cust_source = sprintf("%-20s", $cust_source); $Luser = $Auser[$i]; $user = sprintf("%-20s", $Auser[$i]); $Lsessionid = $Asessionid[$i]; $sessionid = sprintf("%-9s", $Asessionid[$i]); $Lstatus = $Astatus[$i]; $status = sprintf("%-6s", $Astatus[$i]); $Lserver_ip = $Aserver_ip[$i]; $server_ip = sprintf("%-15s", $Aserver_ip[$i]); $call_server_ip = sprintf("%-15s", $Acall_server_ip[$i]); $campaign_id = sprintf("%-10s", $Acampaign_id[$i]); $comments = $Acomments[$i]; $calls_today = sprintf("%-5s", $Acalls_today[$i]); $pausecode = ''; if (preg_match("/INCALL/i", $Lstatus)) { $stmtP = "SELECT count(*) from parked_channels where channel_group='{$Acallerid[$i]}';"; $rsltP = mysql_to_mysqli($stmtP, $link); $rowP = mysqli_fetch_row($rsltP); $parked_channel = $rowP[0]; if ($parked_channel > 0) { $Astatus[$i] = "PARK"; $Lstatus = "PARK"; $status = " PARK "; } else { if (!preg_match("/{$Acallerid[$i]}\|/", $callerids) && !preg_match("/EMAIL/i", $comments) && !preg_match("/CHAT/i", $comments)) { $Acall_time[$i] = $Astate_change[$i]; $Astatus[$i] = "DEAD"; $Lstatus = "DEAD"; $status = " Raccrocher "; } else { if ($Acomments[$i] == "MANUAL") { $stmt = "SELECT uniqueid,channel from vicidial_auto_calls where callerid='{$Acallerid[$i]}' LIMIT 1;"; $rslt = mysql_to_mysqli($stmt, $link); $mandial_to_check = mysqli_num_rows($rslt); if ($mandial_to_check > 0) { $row = mysqli_fetch_row($rslt); if (strlen($row[0]) < 5 and strlen($row[1]) < 5) { $Astatus[$i] = "DIAL"; $Lstatus = "DIAL"; $status = " Manuel "; } } } } if (preg_match("/CHAT/i", $comments)) { $stmtCT = "SELECT chat_id from vicidial_live_chats where chat_creator='{$Auser[$i]}' and lead_id='{$Alead_id[$i]}' order by chat_start_time desc limit 1;"; $rsltCT = mysql_to_mysqli($stmtCT, $link); $chatting_to_print = mysqli_num_rows($rslt); if ($chatting_to_print > 0) { $rowCT = mysqli_fetch_row($rsltCT); $Achat_id = $rowCT[0]; $stmtCL = "SELECT count(*) from vicidial_chat_log where chat_id='{$Achat_id}' and message LIKE "%has left chat";"; $rsltCL = mysql_to_mysqli($stmtCL, $link); $rowCL = mysqli_fetch_row($rsltCL); $left_chat = $rowCL[0]; if ($left_chat > 0) { $Acall_time[$i] = $Astate_change[$i]; $Astatus[$i] = "DEAD"; $Lstatus = "DEAD"; $status = "DEAD C"; } } } } if (preg_match("/AUTO/i", $comments) or strlen($comments) < 1) { $CM = "A"; } else { if (preg_match("/INBOUND/i", $comments)) { $CM = "I"; } else { if (preg_match("/EMAIL/i", $comments)) { $CM = "E"; } else { $CM = "M"; } } } } else { $CM = " "; } if ($UGdisplay > 0) { $user_group = sprintf("%-12s", $Auser_group[$i]); } if ($UidORname > 0) { $user = sprintf("%-20s", $Afull_name[$i]); } if (!preg_match("/INCALL|DIAL|QUEUE|PARK|3-WAY/i", $Astatus[$i])) { $call_time_S = $STARTtime - $Astate_change[$i]; } else { if (preg_match("/3-WAY/i", $Astatus[$i])) { $call_time_S = $STARTtime - $Acall_mostrecent[$i]; } else { $call_time_S = $STARTtime - $Acall_time[$i]; } } if ($status == "READY ") { if ($call_time_S >= 30) { $call_time_S = $call_time_S - 20; } } $call_time_MS = sec_convert($call_time_S, "M"); $call_time_MS = sprintf("%7s", $call_time_MS); $call_time_MS = " {$call_time_MS}"; $tr_class = "status-incall"; if ($Lstatus == "INCALL" or $Lstatus == "PARK") { if ($comments == "CHAT") { $status = "CHAT"; $tr_class = "TRred"; } else { if ($comments == "EMAIL") { $status = "EMAIL"; $tr_class = "TRorange"; } else { if ($call_time_S >= $rt_report_times["incall_short_time"]) { $tr_class = "status-incall"; } if ($call_time_S >= $rt_report_times["incall_medium_time"]) { $tr_class = "status-incall"; } if ($call_time_S >= $rt_report_times["incall_long_time"]) { $tr_class = "status-incall"; } } } } if ($Lstatus == "3-WAY") { if ($call_time_S >= $rt_report_times["threeway_short_time"]) { $tr_class = "status-3way"; } } if ($Lstatus == "DEAD") { if ($call_time_S >= 21600) { $j++; continue; } else { $agent_dead++; $agent_total++; $tr_class = "status-dead"; if ($call_time_S >= $rt_report_times["dead_short_time"]) { $tr_class = "status-dead"; } } } if ($Lstatus == "DISPO") { if ($call_time_S >= 21600) { $j++; continue; } else { $agent_dispo++; $agent_total++; $tr_class = "status-dispo"; if ($call_time_S >= $rt_report_times["paused_short_time"]) { $tr_class = "status-dispo"; } if ($call_time_S >= $rt_report_times["paused_medium_time"]) { $tr_class = "status-dispo"; } if ($call_time_S >= $rt_report_times["paused_long_time"]) { $tr_class = "status-dispo"; } if ($call_time_S >= $rt_report_times["pause_limit"]) { $tr_class = "status-paused"; } } } $pausecodeName = ''; if ($Lstatus == "PAUSED") { if ($agent_pause_codes_active > 0) { $twentyfour_hours_ago = date("Y-m-d H:i:s", mktime(date("H") - 24, date("i"), date("s"), date("m"), date("d"), date("Y"))); $stmtC = "SELECT sub_status from vicidial_agent_log where agent_log_id >= "{$Aagent_log_id[$i]}" and user='{$Luser}' order by agent_log_id desc limit 1;"; $rsltC = mysql_to_mysqli($stmtC, $link); $rowC = mysqli_fetch_row($rsltC); $pausecode = sprintf("%-6s", $rowC[0]); if ($SSenable_pause_code_limits > 0) { $pause_limit_stmt = "SELECT time_limit from vicidial_pause_codes where campaign_id='{$Acampaign_id[$i]}' and pause_code='{$rowC["0"]}'"; $pause_limit_rslt = mysql_to_mysqli($pause_limit_stmt, $link); if (mysqli_num_rows($pause_limit_rslt) > 0) { $pause_limit_row = mysqli_fetch_row($pause_limit_rslt); $pause_limit = $pause_limit_row[0]; } else { $pause_limit = $rt_report_times["pause_limit"]; } } else { $pause_limit = "999999"; } $stmtCC = "SELECT pause_code_name from vicidial_pause_codes where pause_code = '{$pausecode}' and campaign_id='{$Acampaign_id[$i]}';"; $rsltCC = mysql_to_mysqli($stmtCC, $link); $rowCC = mysqli_fetch_row($rsltCC); $pausecodeName = $rowCC[0]; } else { $pausecode = ''; $pause_limit = "999999"; } if ($call_time_S >= 21600) { $j++; continue; } else { $agent_paused++; $agent_total++; $tr_class = "status-paused"; if ($call_time_S >= $rt_report_times["paused_short_time"]) { $tr_class = "status-paused"; } if ($call_time_S >= $rt_report_times["paused_medium_time"]) { $tr_class = "status-paused"; } if ($call_time_S >= $rt_report_times["paused_long_time"]) { $tr_class = "status-paused"; } if ($call_time_S >= $pause_limit) { $tr_class = "status-paused"; } } } if (preg_match("/INCALL|DIAL/i", $status) or preg_match("/QUEUE/i", $status) or preg_match("/3-WAY/i", $status) or preg_match("/PARK/i", $status)) { $agent_incall++; $agent_total++; } if (preg_match("/DIAL/i", $status)) { $agent_indial++; } if (preg_match("/READY/i", $status) or preg_match("/CLOSER/i", $status)) { $agent_ready++; $agent_total++; } if (preg_match("/READY/i", $status) or preg_match("/CLOSER/i", $status)) { if ($RS_agentWAIT == 4) { $tr_class = "status-ready"; if ($call_time_S >= $rt_report_times["waiting_short_time"]) { $tr_class = "status-ready"; } if ($call_time_S >= $rt_report_times["waiting_medium_time"]) { $tr_class = "status-ready"; } if ($call_time_S >= $rt_report_times["waiting_long_time"]) { $tr_class = "status-ready"; } } else { $tr_class = "status-ready"; if ($call_time_S >= $rt_report_times["waiting_medium_time"]) { $tr_class = "status-ready"; } if ($call_time_S >= $rt_report_times["waiting_long_time"]) { $tr_class = "status-ready"; } } } if ($Astatus[$i] == "RING") { $agent_total++; $tr_class = "status-ringing"; if ($call_time_S >= 0) { $tr_class = "status-ringing"; } } $filtered_ingroup = 1; $ecouter = ''; $souffler = ''; $monitor_active = "MONITOR|BARGE|WHISPER"; if (strlen($monitor_phone) > 1 and preg_match("/MONITOR|BARGE|WHISPER/", $monitor_active) and preg_match("/MONITOR/", $RS_ListenBarge)) { $ecouter = " "; } if (strlen($monitor_phone) > 1 and preg_match("/BARGE|WHISPER/", $monitor_active) and preg_match("/BARGE/", $RS_ListenBarge)) { $BARGEstage = "BARGE"; if ($RS_BargeSwap > 0) { $BARGEstage = "BARGESWAP"; } $brave = " "; } if (strlen($monitor_phone) > 1 and preg_match("/WHISPER/", $monitor_active) and preg_match("/WHISPER/", $RS_ListenBarge)) { $souffler = "\xa \xa "; } $vac_stage = ''; $vac_campaign = ''; $INGRP = ''; $INuniqueid = ''; $agentcount++; if ($filtered_ingroup == 1) { if ($status == "INCALL") { $status = "En appel"; } if ($status == "PAUSED") { $status = "Pause " . $pausecodeName . ""; } if ($status == "READY ") { $status = "En attente"; $attentes[] = $call_time_S; } if ($status == "DISPO ") { $status = "En qualif"; } if ($status == "QUEUE ") { $status = "En attente"; } if ($status == "CLOSER") { $status = "Mode R\303\251ception"; } if ($status == " PARK ") { $status = "Mise en attente"; } if ($status == " 3-WAY " or $status == "3-WAY " or $status == "3-WAY") { $status = "Conference \303\xa0 3"; } $typeA = ''; if ($CM == "I") { $typeA = " R\xc3\xa9ception"; } elseif ($CM == "M") { $typeA = " Manuel"; } elseif ($CM == "A") { $typeA = " Emission"; } $statusVente = getStatusSale(); $status_SQL = ''; foreach ($statusVente as $stVente) { $status_SQL .= "'{$stVente}',"; } $status_SQL = preg_replace("/,$/i", '', $status_SQL); $status_SQL = "and status IN({$status_SQL})"; $d1 = date("Y-m-d") . " 00:00:00.000000"; $d2 = date("Y-m-d") . " 23:59:59.000000"; $stmtV = "SELECT user from vicidial_agent_log where event_time <= '{$d2}' and event_time >= '{$d1}' {$status_SQL} and user = '{$Luser}'"; $rsltV = mysql_to_mysqli($stmtV, $link); $number_of_result = mysqli_num_rows($rsltV); $vente_A = 0; while ($rowV = mysqli_fetch_row($rsltV)) { $total_ventes += 1; $vente_A += 1; } $bbb_stmt = "select lists.list_name from vicidial_list as list LEFT JOIN vicidial_lists as lists ON lists.list_id = list.list_id where phone_number='" . $custphone . "'"; $bbb_rslt = mysql_to_mysqli($bbb_stmt, $link); $listeRow = mysqli_fetch_array($bbb_rslt); $Aecho .= "\xa \xa \xa "; if ($listeRow["list_name"] != '') { $Aecho .= ""; } else { $Aecho .= ""; } $vente_A = getTotalVentesToDay($campaign_id, $Luser); $Aecho .= ""; } $j++; } $Aecho .= "
Agent Type Statut TMP APLS T\xc3\xa9l\xc3\xa9Liste VentesActions
" . $user . "" . $typeA . " " . $status . "" . $call_time_MS . " " . $calls_today . " " . $custphone . "" . $listeRow["list_name"] . " " . $vente_A . " " . $ecouter . " " . $souffler . " " . $brave . "\xa \xa
\xa"; $AIDct = ''; $AIDtx = ''; if ($agent_indial > 0) { $AIDct = "/{$agent_indial}"; $AIDtx = " / " . _QXZ("dials"); } } $AIDct = ''; $AIDtx = ''; if ($agent_indial > 0) { $AIDct = " / {$agent_indial}"; $AIDtx = " / " . _QXZ("dials"); } if ($agent_total > 0) { echo "
"; echo "
\xa

Campagne : " . $ay_groupe_name[$kk] . "\xa

"; if ($out_live > 0) { echo "
" . $out_live . " Appel(s) en attente d'agent
"; } echo "
\xa
"; echo "
"; $attente = 0; $moyenne = 0; if (!empty($attentes)) { $attente = max($attentes); $moyenne = array_sum($attentes) / count($attentes); $moyenne = intval($moyenne); } $vitesse = $DIALlev * 100 / 12; echo "
\xa
\xa
Trafic sortant
\xa
\xa  " . $attente . " s
Composition\xa
\xa " . $out_total . "\xa
\xa
\xa Contacts disponibles\xa
" . $DAleads . "
\xa
\xa
\xa
Appels
" . $callsTODAY . "
\xa
Abandons
" . floor($drpctTODAY) . "%
\xa
\xa
\xa
Vitesse
\xa
" . floor($vitesse) . " %
\xa
\xa
\xa
\xa
"; echo $ingroup_detail; echo "
"; $total_ventes = getTotalVentesToDay($Acampaign_id[$i]); echo "
\xa
\xa
" . $agent_total . " Agents
\xa
" . $agent_ready . " Attente\xa
\xa
\xa
\xa " . $agent_incall . " Appel
\xa
" . $agent_paused . " Pause
\xa
\xa
" . $agent_dispo . "\xa Qualification\xa
\xa\xa
\xa " . $agent_dead . " Fin d'appel
\xa
\xa " . $total_ventes . "\xa Ventes\xa
\xa
\xa
"; echo "
"; echo "{$Aecho}"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; $displayAgent = 1; } $kk++; } goto vu1X3; u_I8A: $PHP_AUTH_USER = preg_replace("/[^-_0-9a-zA-Z]/", '', $PHP_AUTH_USER); goto xV6Gt; MQft_: $auth_message = user_authorization($PHP_AUTH_USER, $PHP_AUTH_PW, "REPORTS", 0, 0); goto YEoyp; aIv9G: if (!isset($group)) { $group = "ALL-ACTIVE"; } goto kvMbP; WwLuJ: $stmt = "SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='{$LOGuser_group}';"; goto FLaxT; g0DdS: $rt_report_times["threeway_short_time"] = 10; goto odo_1; xu7tG: $ay_groupes = array(); goto cCpCz; vpDWj: $LOGallowed_campaigns = $row[0]; goto h5i5B; OBNud: $LOGmodify_campaigns = $row[35]; goto FutOL; vgDEL: $regexLOGallowed_campaigns = " {$LOGallowed_campaigns} "; goto SLHVp; k2El3: $LOGmodify_remoteagents = $row[41]; goto xS5Bw; LOUUC: $LOGallowed_reports = $row[1]; goto uy_wz; aMbyJ: $PHP_AUTH_USER = $_SESSION["PHP_AUTH_USER"]; goto KeElM; Fp4Fn: if (!isset($usergroup)) { $usergroup = ''; } goto HjTe5; RWInm: $rt_report_times["waiting_medium_time"] = 60; goto ku10C; AtABl: $orderby = preg_replace("/[^-_0-9a-zA-Z]/", '', $orderby); goto xGBqQ; cCpCz: while ($i < $groups_to_print) { $row = mysqli_fetch_row($rslt); $ay_groupes[] = $row[0]; $ay_groupe_name[] = $row[1]; $LISTgroups[$i] = $row[0]; $LISTnames[$i] = $row[1]; $allactivecampaigns .= "'{$LISTgroups[$i]}',"; $i++; } goto ylQNv; kx8yc: $CALLSdisplay = preg_replace("/[^-_0-9a-zA-Z]/", '', $CALLSdisplay); goto vm2JD; RkvvL: $RS_INcolumnsHIDE = 0; goto JuUhe; sNw2G: $LOGmodify_labels = $row[75]; goto U9nkn; jN3IZ: $LOGexport_reports = $row[64]; goto xW0iy; Lnvq6: if (file_exists("options.php")) { require "options.php"; } goto ASQrG; VRXRP: $group = preg_replace("/[^-_0-9a-zA-Z]/", '', $group); goto EPE7d; xV6Gt: $PHP_AUTH_PW = preg_replace("/[^-_0-9a-zA-Z]/", '', $PHP_AUTH_PW); goto qGrtZ; MRgsz: if (!preg_match("/{$report_name}/", $LOGallowed_reports) and !preg_match("/ALL REPORTS/", $LOGallowed_reports)) { header("Location: /?error=deconnecter"); echo _QXZ("You are not allowed to view this report") . ": |{$PHP_AUTH_USER}|{$report_name}|" . _QXZ("{$report_name}") . "| "; die; } goto KnSRu; ZFGKl: $LOGmodify_users = $row[34]; goto OBNud; PD0L1: $epochONEminuteAGO = $STARTtime - 60; goto Thx1Q; BrERS: if ($auth > 0) { $stmt = "SELECT count(*) from vicidial_users where user='{$PHP_AUTH_USER}' and user_level > 7 and view_reports='1';"; $rslt = mysql_to_mysqli($stmt, $link); $row = mysqli_fetch_row($rslt); $admin_auth = $row[0]; $stmt = "SELECT count(*) from vicidial_users where user='{$PHP_AUTH_USER}' and user_level > 6 and view_reports='1';"; if ($DB) { echo "|{$stmt}| "; } $rslt = mysql_to_mysqli($stmt, $link); $row = mysqli_fetch_row($rslt); $reports_auth = $row[0]; if ($reports_auth < 1) { $VDdisplayMESSAGE = _QXZ("You are not allowed to view reports"); Header("Content-type: text/html; charset=utf-8"); echo "{$VDdisplayMESSAGE}: |{$PHP_AUTH_USER}|{$auth_message}| "; die; } if ($reports_auth > 0 and $admin_auth < 1) { $ADD = 999999; $reports_only_user = 1; } } else { $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again"); if ($auth_message == "LOCK") { $VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes"); Header("Content-type: text/html; charset=utf-8"); echo "{$VDdisplayMESSAGE}: |{$PHP_AUTH_USER}|{$auth_message}|\xa"; die; } if ($auth_message == "IPBLOCK") { $VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed") . ": {$ip}"; Header("Content-type: text/html; charset=utf-8"); echo "{$VDdisplayMESSAGE}: |{$PHP_AUTH_USER}|{$auth_message}|\xa"; die; } header("Location: /?error=deconnecter"); echo "{$VDdisplayMESSAGE}: |{$PHP_AUTH_USER}|{$PHP_AUTH_PW}|{$auth_message}| "; die; } goto nu3F7; pHy1r: $LOGmodify_scripts = $row[37]; goto M19HA; zskBH: $CUSTPHONEdisplay = preg_replace("/[^-_0-9a-zA-Z]/", '', $CUSTPHONEdisplay); goto DWtqU; q7yf2: $NOW_TIME = date("Y-m-d H:i:s"); goto HdQPo; ywtE4: $stmt = "SELECT phone_login from vicidial_users where user='{$PHP_AUTH_USER}';"; goto Rs51j; M19HA: $LOGmodify_filters = $row[38]; goto rFHsX; y2LRO: $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,agent_whisper_enabled,allow_chats,cache_carrier_stats_realtime,report_default_format,ofcom_uk_drop_calc,enable_pause_code_limits,timeclock_end_of_day,allow_web_debug FROM system_settings;"; goto G1hpD; j4uQp: $groups_to_print++; goto xu7tG; q3omr: $report_name = "Real-Time Main Report"; goto msAwU; iSy3L: $rt_report_times["pause_limit"] = 999999; goto u_hZ_; bFmO6: $timeFIVEminutesAGO = date("Y-m-d H:i:s", $epochFIVEminutesAGO); goto btWXt; kvMbP: if (!isset($groups)) { $groups = array(); } goto hnODT; z3ENo: $LOGdelete_user_groups = $row[9]; goto rsMbX; cWjbn: if (!isset($UidORname)) { $UidORname = 1; } goto TptnY; rmSmI: $DB = preg_replace("/[^0-9]/", '', $DB); goto kYtFP; FutOL: $LOGmodify_lists = $row[36]; goto pHy1r; RXb1q: $rt_report_times["waiting_short_time"] = 30; goto RWInm; JOwoQ: if ($SSallow_web_debug < 1) { $DB = 0; } goto bekmF; IMEPW: $rslt = mysql_to_mysqli($stmt, $link); goto i1RIx; boxsh: $rslt = mysql_to_mysqli($stmt, $link); goto iElM8; UGSnY: $LOGdelete_users = $row[8]; goto z3ENo; iElM8: $row = mysqli_fetch_row($rslt); goto DTxB_; xldUO: $row = mysqli_fetch_row($rslt); goto bleKD; MsRa9: $RS_BargeSwap = 0; goto Lnvq6; nu3F7: $stmt = "SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,modify_contacts,modify_same_user_level from vicidial_users where user='{$PHP_AUTH_USER}';"; goto boxsh; BcPzF: $PHP_SELF = $_SERVER["PHP_SELF"]; goto CzTO4; lqbIo: $with_inbound = preg_replace("/[^-_0-9a-zA-Z]/", '', $with_inbound); goto OYnR2; vu1X3: if ($displayAgent == 0) { echo "
Aucun agent active
"; } goto MgMa1; y2Weu: $LOGload_leads = $row[14]; goto rz01g; H6Rxc: $rsltPr = mysql_to_mysqli($stmtPr, $link); goto wQPBL; au4LP: if (!empty($rowPr)) { $profil = "superviseur"; $crmgroup = explode(" ", $rowPr["crmgroup"]); $gg = "'---ALL---',"; foreach ($crmgroup as $cg) { $gg .= "'" . $cg . "',"; } $gg = substr_replace($gg, '', -1); $allow_usergroup = "user_group IN({$gg})"; } goto ywtE4; TRUm8: while ($crow = mysqli_fetch_row($container_rslt)) { $realtime_times = $crow[0]; $rt_times = explode(" ", $realtime_times); for ($q = 0; $q < count($rt_times); $q++) { $rt_array = explode("=>", $rt_times[$q]); $var_name = trim($rt_array[0]); $var_value = preg_replace("/[^0-9]/", '', trim($rt_array[1])); $rt_report_times["{$var_name}"] = $var_value; } } goto aMbyJ; rsMbX: $LOGdelete_lists = $row[10]; goto LqDtW; LlWFf: $epochONEhourAGO = $STARTtime - 3600; goto Uth1C; JVJCV: $STARTtime = date("U"); goto PD0L1; nhesB: $epochSIXhoursAGO = $STARTtime - 21600; goto GqHXt; SLHVp: $allactivecampaigns = ''; goto Ujz7P; KeElM: $PHP_AUTH_PW = $_SESSION["PHP_AUTH_PW"]; goto BcPzF; QVGnT: $timeSIXhoursAGO = date("Y-m-d H:i:s", $epochSIXhoursAGO); goto u_I8A; nUcA0: $displayAgent = 0; goto EtaoE; x2Wqy: ob_start(); goto RmZb6; Ndf2X: $RS_ListenBarge = "MONITOR|BARGE|WHISPER"; goto seea7; Qd7RM: $LOGmodify_dids = $row[56]; goto MixOJ; ZQhvi: $LOGmodify_same_user_level = $row[82]; goto WwLuJ; xGBqQ: $SERVdisplay = preg_replace("/[^-_0-9a-zA-Z]/", '', $SERVdisplay); goto kx8yc; Tw2mQ: if (!isset($ingroup_filter)) { $ingroup_filter = array(); } goto Fp4Fn; yMet5: $LOGmodify_usergroups = $row[40]; goto k2El3; gmU51: if (!isset($with_inbound)) { if ($outbound_autodial_active > 0) { $with_inbound = "Y"; } else { $with_inbound = "O"; } } goto iw7VC; G8Jic: $LISTgroups[$i] = "ALL-ACTIVE"; goto SjSzc; ptsap: if (!isset($CUSTPHONEdisplay)) { $CUSTPHONEdisplay = 0; } goto tm1xh; MgMa1: ?>