Added custom colors/logos for customer chat

Added user nickname for customer chat
Added trim to campaign number and dtmf preset updates
Fixed issue with new HTML format for Team Performance Detail report
Added MANUALDIALLINK script option for agent scripts

git-svn-id: svn://192.168.202.10@2579 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2016-08-18 18:00:56 +00:00
parent 6e8828f276
commit 7f10d76a83
15 changed files with 506 additions and 128 deletions
+30 -7
View File
@@ -17,13 +17,14 @@
# 160108-2300 - Changed some mysqli_query to mysql_to_mysqli for consistency
# 160303-0051 - Added code for chat transfers
# 160719-1043 - Bug fixes for non-owner chats, and other issues
# 160818-1236 - Addec chat colors, usre nickname and scrolling
#
require("dbconnect_mysqli.php");
require("functions.php");
$NOW_TIME = date("Y-m-d H:i:s");
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$chat_background_array=array(); # Defined further down
$style_array=array("", "italics", "bold italics");
if (isset($_GET["action"])) {$action=$_GET["action"];}
@@ -89,6 +90,9 @@ if (isset($_GET["chat_xfer_value"])) {$chat_xfer_value=$_GET["chat_xfer_valu
$chat_member_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/',"",$chat_member_name);
if (!$user) {echo "No user, no using."; exit;}
if (file_exists('options.php'))
{require('options.php');}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$VUselected_language = '';
@@ -494,7 +498,7 @@ if ($action=="start_chat" && $user && $server_ip) {
if (!$chat_group_id) {
echo "NO_GROUP";
} else {
$user_stmt="select full_name from vicidial_users where user='$user'";
$user_stmt="select if(user_nickname!='' and user_nickname is not null, user_nickname, full_name) from vicidial_users where user='$user'";
$user_rslt=mysql_to_mysqli($user_stmt, $link);
if (mysqli_num_rows($user_rslt)>0) {
$live_agent_stmt="select * from vicidial_live_agents where user='$user' and status='PAUSED'";
@@ -684,7 +688,7 @@ if ($action=="update_agent_chat_window" && $chat_id) {
$live_stmt="select * from vicidial_live_chats vlc, vicidial_chat_participants vcp where vlc.chat_id='$chat_id' and status='LIVE' and vlc.chat_id=vcp.chat_id and vcp.chat_member='$user'";
$live_rslt=mysql_to_mysqli($live_stmt, $link);
if (mysqli_num_rows($live_rslt)>0) {
echo "<font class='chat_title bold'>"._QXZ("Current chat").": $chat_id</font><BR/>\n";
echo "<font class='chat_title bold'>"._QXZ("Current chat").": $chat_id</font><BR/>";
# Create color-coding for chat
$stmt="select * from vicidial_chat_log where chat_id='$chat_id' order by message_time asc";
@@ -697,21 +701,33 @@ if ($action=="update_agent_chat_window" && $chat_id) {
}
}
$chat_color_stmt="select menu_background, frame_background, std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background from system_settings s, vicidial_screen_colors v where s.agent_screen_colors=v.colors_id and length(frame_background)=6 and length(menu_background)=6 limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
if(mysqli_num_rows($color_rslt)>0 && $use_system_colors>0) {
$color_row=mysqli_fetch_array($color_rslt);
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[frame_background]", "#$color_row[menu_background]");
} else {
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$chat_background_array=array("#FFCCCC", "#CCCCFF", "#CCFFCC", "#FFCCFF", "#CCFFFF", "#CCCC99", "#CCCCCC");
}
## GRAB CHAT MESSAGES AND DISPLAY THEM
if (!$user_level || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";}
$stmt="select * from vicidial_chat_log where chat_id='$chat_id' $user_level_clause order by message_time asc";
echo "<table border='0' cellpadding='3' width='100%'>";
$rslt=mysql_to_mysqli($stmt, $link);
while ($row=mysqli_fetch_row($rslt)) {
$chat_color_key=array_search("$row[4]", $chat_members);
$row[2]=preg_replace('/\n/', '<BR/>', $row[2]);
echo "<li><font color='$color_array[$chat_color_key]' class='chat_message bold'>$row[5]</font> <font class='chat_timestamp bold'>($row[3])</font> - <font class='chat_message ".$style_array[$row[6]]."'>$row[2]</font></li>\n";
echo "<tr><td bgcolor='$chat_background_array[$chat_color_key]'><li><font color='$color_array[$chat_color_key]' class='chat_message bold'>$row[5]</font> <font class='chat_timestamp bold'>($row[3])</font> - <font class='chat_message ".$style_array[$row[6]]."'>$row[2]</font></li></td></tr>";
}
echo "</table>";
## PLAY AUDIO FILE IF THERE ARE NEW MESSAGES
$current_messages=mysqli_num_rows($rslt);
echo "<input type='hidden' id='current_message_count' name='current_message_count' value='$current_messages'>\n";
echo "<input type='hidden' id='current_message_count' name='current_message_count' value='$current_messages'>\n$current_messages";
} else {
echo "<font class='chat_title bold'>"._QXZ("Click on a live chat at right to join it.")."</font><BR/>\n";
}
@@ -982,6 +998,13 @@ if ($action=="join_chat" && $user && $chat_id && $chat_member_name) {
$del_stmt="delete from vicidial_chat_participants where chat_member='$user'";
$del_rslt=mysql_to_mysqli($del_stmt, $link);
$nickname_stmt="select user_nickname from vicidial_users where user='$user' and user_nickname is not null and user_nickname!=''";
$nickname_rslt=mysql_to_mysqli($nickname_stmt, $link);
if (mysqli_num_rows($nickname_rslt)>0) {
$nickname_row=mysqli_fetch_array($nickname_rslt);
$chat_member_name=$nickname_row["user_nickname"];
}
$ins_stmt="insert into vicidial_chat_participants(chat_id, chat_member, chat_member_name, vd_agent) values('$chat_id', '$user', '".mysqli_real_escape_string($link, $chat_member_name)."', 'Y')";
$ins_rslt=mysql_to_mysqli($ins_stmt, $link);
if (mysqli_affected_rows($link)==0) {
+38 -9
View File
@@ -15,6 +15,7 @@
# 151213-1107 - Added variable filtering
# 151218-0913 - Added missing translation code and user auth
# 160303-0051 - Added code for chat transfers
# 160818-1235 - Added line colors and scrolling
#
require("dbconnect_mysqli.php");
@@ -243,14 +244,40 @@ function UpdateChatWindow() {
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var fullchatlog = xmlhttp.responseText;
document.getElementById('ChatDisplay').innerHTML=fullchatlog;
// var fullchatlog = xmlhttp.responseText;
var chatlogresponse = xmlhttp.responseText;
var chatlog_array = chatlogresponse.split("\n");
var fullchatlog = chatlog_array[0];
var live_message_count = chatlog_array[1];
var last_live_message_count=document.getElementById('live_message_count_field');
if (live_message_count!=last_live_message_count.value) {
document.getElementById('ChatDisplay').innerHTML=fullchatlog;
last_live_message_count.value=live_message_count;
}
// document.getElementById('ChatDisplay').innerHTML=fullchatlog;
var current_message_field_update = document.getElementById('current_message_count');
if (current_message_field_update != null) {var current_message_count_update=current_message_field_update.value;}
if (clickMute==0 && current_message_count_update>current_message_count && !document.getElementById("MuteCustomerChatAlert").checked)
{document.getElementById("CustomerChatAudioAlertFile").play();}
else if (clickMute>0)
{clickMute=0;}
// document.getElementById('ChatDisplay').innerHTML+=current_message_count_update+" > "+current_message_count;
if (current_message_count_update>current_message_count)
{
var myDiv = document.getElementById('ChatDisplay');
document.getElementById('ChatDisplay').scrollTop = document.getElementById('ChatDisplay').scrollHeight;
if (clickMute==0 && !document.getElementById("MuteCustomerChatAlert").checked)
{
document.getElementById("CustomerChatAudioAlertFile").play();
}
else if (clickMute>0)
{
clickMute=0;
}
}
}
}
delete xmlhttp;
@@ -768,7 +795,7 @@ if (!$user) {
exit;
}
$user_stmt="select full_name from vicidial_users where user='$user' limit 1";
$user_stmt="select if(user_nickname!='' and user_nickname is not null, user_nickname, full_name) from vicidial_users where user='$user' limit 1";
$user_rslt=mysql_to_mysqli($user_stmt, $link);
$inchat_html=""; $nochat_html="";
$autojoin_js_fx="StartRefresh();";
@@ -806,11 +833,12 @@ if($child_window) {
<table width='100%' border='0'>
<tr>
<td class='chat_window' height='300' width='*'>
<span id='ChatDisplay' name='ChatDisplay' style=" overflow-y: auto; overflow-x: none;">
<span id='ChatDisplay' name='ChatDisplay' style="display:block;height:300px;overflow-y:auto;overflow-x:none;z-index:0;">
</span>
<!-- <span style="display:block;top:280px;right:25px;z-index:1"><img border="0" src="images/VICIchat_powered_logo.gif" width="123" height="30"></span> //-->
</td>
<td width='200' valign='top'>
<span id='ActiveChats' name='ActiveChats' style=" overflow-y: auto; overflow-x: none;">
<span id='ActiveChats' name='ActiveChats' style="overflow-y:auto; overflow-x:none;">
</span>
</td>
</tr>
@@ -939,6 +967,7 @@ if($child_window) {
<input type='hidden' id='chat_id' name='chat_id' value='<?php echo $chat_id; ?>'>
<input type='hidden' id='chat_group_id' name='chat_group_id' value='<?php echo $chat_group_id; ?>'>
<input type='hidden' id='chat_creator' name='chat_creator' value='<?php echo $chat_creator; ?>'>
<input type='hidden' id='live_message_count_field' name='live_message_count_field' value='0'>
<input type='hidden' id='pass' name='pass' value='<?php echo $pass; ?>'>
<input type='hidden' id='lead_id' name='lead_id' value='<?php echo $lead_id; ?>'>
<input type='hidden' id='server_ip' name='server_ip' value='<?php echo $server_ip; ?>'>
+6 -3
View File
@@ -1,7 +1,7 @@
<?php
# vdc_script_display.php
#
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed display the contents of the SCRIPT tab in the agent interface
#
@@ -32,10 +32,11 @@
# 150703-2034 - Added option to fully urlencode variables if IFRAME is used in script Issue #864
# 150725-1622 - Added entry_date variable
# 150923-2028 - Added DID custom variables
# 160818-1226 - Added MANUALDIALLINK option
#
$version = '2.12-26';
$build = '150923-2028';
$version = '2.12-27';
$build = '160818-1226';
require_once("dbconnect_mysqli.php");
require_once("functions.php");
@@ -842,6 +843,8 @@ if (preg_match('/--A--TABLEper_call_notes--B--/i',$script_text))
$script_text = preg_replace("/\n/i","<BR>",$script_text);
$script_text = preg_replace('/--A--TABLEper_call_notes--B--/i',"$NOTESout",$script_text);
$manual_dial_code = "<a href=\"#\" onclick=\"NeWManuaLDiaLCalL('NO','','','','','YES');return false;\">" . _QXZ("MANUAL DIAL") ."</a>";
$script_text = preg_replace('/--A--MANUALDIALLINK--B--/i',$manual_dial_code,$script_text);
$script_text = stripslashes($script_text);
+44
View File
@@ -1,3 +1,15 @@
.chat_title { font-family: Arial, Helvetica, sans-serif; font-size: 14pt}
.chat_message { font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
.chat_timestamp { font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
.bold {font-weight: bold;}
.italics {font-style: italic;}
.alert {
font-weight: bold;
color:#FFFFFF;
background-color:#FF0000;
}
input.red_btn{
font-family: Arial, Sans-Serif;
font-size: 10px;
@@ -34,6 +46,24 @@ input.blue_btn{
border-right-color:#000033;
border-bottom-color:#000033;
}
textarea.chat_window {
font-family: Arial, Sans-Serif;
font-size: 11px;
margin-bottom: 3px;
padding: 2px;
border: solid 1px #000066;
}
td.chat_window {
border:2px solid #000000;
padding: 5px;
vertical-align: top;
/*
background-image: url("../images/VICIchat_powered_logo.png");
background-repeat: no-repeat;
background-position: bottom 5px right 25px;
*/
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(222,222,222,0) 50%, rgba(222,222,222,0) 50%, rgba(222,222,222,1) 100%);
}
input.form_field {
font-family: Arial, Sans-Serif;
font-size: 10px;
@@ -55,3 +85,17 @@ select.form_field {
padding: 2px;
border: solid 1px #000066;
}
div.logo_container {
width: 123px;
height: 30px;
position: absolute bottom left;
/* text-align: center;
background: rgb(0, 150, 0); /* Fall-back for browsers that don't support rgba
background: rgba(0, 150, 0, .5); */
}
img.small_logo {
max-width:123px;
max-height:30px;
width:auto;
height:auto;
}
-82
View File
@@ -37,85 +37,3 @@ ul.treeview li:last-child {
/* background: #fff url(images/lastnode.png) no-repeat; */
margin-bottom: 20px;
}
.chat_title { font-family: Arial, Helvetica, sans-serif; font-size: 11pt}
.chat_message { font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
.chat_timestamp { font-family: Arial, Helvetica, sans-serif; font-size: 8pt}
.bold {font-weight: bold;}
.italics {font-style: italic;}
.alert {
font-weight: bold;
color:#FFFFFF;
background-color:#FF0000;
}
input.red_btn{
font-family: Arial, Sans-Serif;
font-size: 10px;
color:#FFFFFF;
font-weight:bold;
background-color:#990000;
border:2px solid;
border-top-color:#FFCCCC;
border-left-color:#FFCCCC;
border-right-color:#330000;
border-bottom-color:#330000;
}
input.green_btn{
font-family: Arial, Sans-Serif;
font-size: 10px;
color:#FFFFFF;
font-weight:bold;
background-color:#009900;
border:2px solid;
border-top-color:#CCFFCC;
border-left-color:#CCFFCC;
border-right-color:#003300;
border-bottom-color:#003300;
}
input.blue_btn{
font-family: Arial, Sans-Serif;
font-size: 10px;
color:#FFFFFF;
font-weight:bold;
background-color:#000099;
border:2px solid;
border-top-color:#CCCCFF;
border-left-color:#CCCCFF;
border-right-color:#000033;
border-bottom-color:#000033;
}
textarea.chat_window {
font-family: Arial, Sans-Serif;
font-size: 11px;
margin-bottom: 3px;
padding: 2px;
border: solid 1px #000066;
}
td.chat_window {
border:2px solid #000000;
padding: 5px;
vertical-align: top;
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(222,222,222,0) 50%, rgba(222,222,222,0) 50%, rgba(222,222,222,1) 100%);
}
input.form_field {
font-family: Arial, Sans-Serif;
font-size: 10px;
margin-bottom: 3px;
padding: 2px;
border: solid 1px #000066;
}
textarea.form_field {
font-family: Arial, Sans-Serif;
font-size: 10px;
margin-bottom: 3px;
padding: 2px;
border: solid 1px #000066;
}
select.form_field {
font-family: Arial, Sans-Serif;
font-size: 10px;
margin-bottom: 3px;
padding: 2px;
border: solid 1px #000066;
}
+229 -6
View File
@@ -11,12 +11,12 @@
# 160203-1051 - Added display of chat message after ending it
# 160303-0055 - Added code for chat transfers
# 160725-1711 - Fixed nested iframe issue
# 160805-2315 - Added coding to show logos in customer display
#
require("dbconnect_mysqli.php");
require("functions.php");
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$style_array=array("", "italics", "bold italics");
if (isset($_GET["action"])) {$action=$_GET["action"];}
@@ -61,6 +61,7 @@ $language = preg_replace('/[^-\_0-9a-zA-Z]/','',$language);
$chat_member_name = preg_replace("/\'|\"|\\\\|;/","",$chat_member_name);
$available_agents = preg_replace('/[^-\_0-9a-zA-Z]/','',$available_agents);
$show_email = preg_replace('/[^-\_0-9a-zA-Z]/','',$show_email);
$chat_message = preg_replace('/\|/', '&#124;', $chat_message);
if ($non_latin < 1)
{
@@ -72,6 +73,11 @@ else
$user = preg_replace("/\'|\"|\\\\|;/","",$user);
}
$use_agent_colors=1;
if (file_exists('options.php'))
{require('options.php');}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$VUselected_language='';
@@ -205,6 +211,68 @@ if ($action=="update_chat_window" && $chat_id) {
}
}
## DISPLAY LOGO ON SCREEN EVEN AFTER CHAT IS ENDED
$chat_color_stmt="select menu_background, frame_background, std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background, web_logo from vicidial_inbound_groups vig, vicidial_screen_colors v where vig.group_id='$group_id' and vig.customer_chat_screen_colors=v.colors_id and length(frame_background)=6 and length(menu_background)=6 limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
$web_logo=""; $filepath="vicidial/images";
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0) {
$color_row=mysqli_fetch_array($color_rslt);
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[frame_background]", "#$color_row[menu_background]");
# switch ($color_row["web_logo"]) {
# case "default_new":
# $color_row["web_logo"]=".png";
# break;
# case "default_old";
# $color_row["web_logo"]=".gif";
# $filepath="vicidial";
# break;
# }
# $web_logo=$color_row["web_logo"];
} else {
# if(mysqli_num_rows($color_rslt)>0) {
# $color_row=mysqli_fetch_array($color_rslt);
# switch ($color_row["web_logo"]) {
# case "default_new":
# $color_row["web_logo"]=".png";
# break;
# case "default_old";
# $color_row["web_logo"]=".gif";
# $filepath="vicidial";
# break;
# }
# $web_logo=$color_row["web_logo"];
# }
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$chat_background_array=array("#FFCCCC", "#CCCCFF", "#CCFFCC", "#FFCCFF", "#CCFFFF", "#CCCC99", "#CCCCCC");
}
# if (!preg_match("/\.(jpg|gif|png|bmp)$/", $web_logo)) {$web_logo.=".png";}
$chat_status="<font color='#900'>INACTIVE</font>";
echo "$chat_status|";
# echo "<table border='0' width='100%'>\n";
# echo "<tr>\n";
# echo "<td align='left' width='50%' valign='top'>\n";
# echo "<font class='chat_title bold'>"._QXZ("Current chat").": <font color='#900'>INACTIVE</font></font>\n";
# echo "</td>\n";
# echo "<td align='right' width='50%' valign='top'>\n";
# if (file_exists("../$filepath/vicidial_admin_web_logo$web_logo"))
# {
# echo "<img class='small_logo' src='/$filepath/vicidial_admin_web_logo$web_logo'>\n";
# }
# else
# {
# if (file_exists("./images/vicidial_admin_web_logo$web_logo"))
# {
# echo "<img class='small_logo' src='images/vicidial_admin_web_logo$web_logo'>\n";
# }
# }
# echo "</td>\n";
# echo "</tr>\n</table>\n";
## GRAB ARCHIVED CHAT MESSAGES AND DISPLAY THEM
if (!$user_level || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";}
$stmt="SELECT * from vicidial_chat_log_archive where chat_id='$chat_id' $user_level_clause order by message_time asc";
@@ -212,7 +280,7 @@ if ($action=="update_chat_window" && $chat_id) {
while ($row=mysqli_fetch_row($rslt)) {
$chat_color_key=array_search("$row[4]", $chat_members);
$row[2]=preg_replace('/\n/', '<BR/>', $row[2]);
echo "<li><font color='$color_array[$chat_color_key]' class='chat_message bold'>$row[5]</font> <font class='chat_timestamp bold'>($row[3])</font> - <font class='chat_message ".$style_array[$row[6]]."'>$row[2]</font></li>\n";
echo "<li bgcolor='$chat_background_array[$chat_color_key]'><font color='$color_array[$chat_color_key]' class='chat_message bold'>$row[5]</font> <font class='chat_timestamp bold'>($row[3])</font> - <font class='chat_message ".$style_array[$row[6]]."'>$row[2]</font></li>\n";
}
} else {
@@ -229,7 +297,46 @@ if ($action=="update_chat_window" && $chat_id) {
$live_stmt="SELECT * from vicidial_live_chats vlc, vicidial_chat_participants vcp where vlc.chat_id='$chat_id' and (status='LIVE' or (status='WAITING' and transferring_agent is not null)) and vlc.chat_id=vcp.chat_id and vcp.chat_member='$user'";
$live_rslt=mysql_to_mysqli($live_stmt, $link);
if (mysqli_num_rows($live_rslt)>0) {
echo "<font class='chat_title bold'>"._QXZ("Current chat").": $chat_id</font><BR/>\n";
$chat_color_stmt="select menu_background, frame_background, std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background, web_logo from vicidial_inbound_groups vig, vicidial_screen_colors v where vig.group_id='$group_id' and vig.customer_chat_screen_colors=v.colors_id and length(frame_background)=6 and length(menu_background)=6 limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
# $web_logo=""; $filepath="vicidial/images";
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0) {
$color_row=mysqli_fetch_array($color_rslt);
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[frame_background]", "#$color_row[menu_background]");
# switch ($color_row["web_logo"]) {
# case "default_new":
# $color_row["web_logo"]=".png";
# break;
# case "default_old";
# $color_row["web_logo"]=".gif";
# $filepath="vicidial";
# break;
# }
# $web_logo=$color_row["web_logo"];
} else {
# if(mysqli_num_rows($color_rslt)>0) {
# $color_row=mysqli_fetch_array($color_rslt);
# switch ($color_row["web_logo"]) {
# case "default_new":
# $color_row["web_logo"]=".png";
# break;
# case "default_old";
# $color_row["web_logo"]=".gif";
# $filepath="vicidial";
# break;
#
# }
# $web_logo=$color_row["web_logo"];
# }
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$chat_background_array=array("#FFCCCC", "#CCCCFF", "#CCFFCC", "#FFCCFF", "#CCFFFF", "#CCCC99", "#CCCCCC");
}
# if (!preg_match("/\.(jpg|gif|png|bmp)$/", $web_logo)) {$web_logo.=".png";}
$chat_status="<font color='#090'>ACTIVE</font>";
echo "$chat_status|";
# Create color-coding for chat
$stmt="SELECT * from vicidial_chat_log where chat_id='$chat_id' order by message_time asc";
@@ -242,17 +349,20 @@ if ($action=="update_chat_window" && $chat_id) {
}
}
## GRAB CHAT MESSAGES AND DISPLAY THEM
if (!$user_level || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";}
$stmt="SELECT * from vicidial_chat_log where chat_id='$chat_id' $user_level_clause order by message_time asc";
echo "<table border='0' cellpadding='3' width='100%'>\n";
$rslt=mysql_to_mysqli($stmt, $link);
while ($row=mysqli_fetch_row($rslt)) {
$chat_color_key=array_search("$row[4]", $chat_members);
$row[2]=preg_replace('/\n/', '<BR/>', $row[2]);
echo "<li><font color='$color_array[$chat_color_key]' class='chat_message bold'>$row[5]</font> <font class='chat_timestamp bold'>($row[3])</font> - <font class='chat_message ".$style_array[$row[6]]."'>$row[2]</font></li>\n";
echo "<tr><td bgcolor='$chat_background_array[$chat_color_key]'><li><font color='$color_array[$chat_color_key]' class='chat_message bold'>$row[5]</font> <font class='chat_timestamp bold'>($row[3])</font> - <font class='chat_message ".$style_array[$row[6]]."'>$row[2]</font></li></td></tr>\n";
}
echo "</table>\n";
if ($status_row[0]=="WAITING" && $status_row[2]!="") {
echo "<BR><font class='chat_message bold'>"._QXZ("Currently being transferred, waiting for agent...")."</font><BR/>\n";
@@ -263,11 +373,124 @@ if ($action=="update_chat_window" && $chat_id) {
echo "<input type='hidden' id='current_message_count' name='current_message_count' value='$current_messages'>\n";
} else {
echo "<font class='chat_title bold'>"._QXZ("You have left chat").": $chat_id.</font><BR/><BR/><font class='chat_title'><a href='".$chat_url."?group_id=$group_id&language=$language&available_agents=$available_agents&show_email=$show_email' target='_parent'>"._QXZ("GO BACK TO CHAT FORM")."</a></font>\n";
$chat_status="<font color='#900'>INACTIVE</font>";
echo "$chat_status|";
$live_stmt="SELECT * from vicidial_live_chats vlc, vicidial_chat_participants vcp where vlc.chat_id='$chat_id' and (status='LIVE' or (status='WAITING' and transferring_agent is not null)) and vlc.chat_id=vcp.chat_id and vcp.chat_member='$user'";
$live_rslt=mysql_to_mysqli($live_stmt, $link);
if (mysqli_num_rows($live_rslt)>0) {
$chat_color_stmt="select menu_background, frame_background, std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background, web_logo from vicidial_inbound_groups vig, vicidial_screen_colors v where vig.group_id='$group_id' and vig.customer_chat_screen_colors=v.colors_id and length(frame_background)=6 and length(menu_background)=6 limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0) {
$color_row=mysqli_fetch_array($color_rslt);
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[frame_background]", "#$color_row[menu_background]");
} else {
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$chat_background_array=array("#FFCCCC", "#CCCCFF", "#CCFFCC", "#FFCCFF", "#CCFFFF", "#CCCC99", "#CCCCCC");
}
}
# Create color-coding for chat
$stmt="SELECT * from vicidial_chat_log where chat_id='$chat_id' order by message_time asc";
$rslt=mysql_to_mysqli($stmt, $link);
$chat_members=array();
while ($row=mysqli_fetch_row($rslt)) {
if (!in_array("$row[4]", $chat_members)) {
array_push($chat_members, "$row[4]");
}
}
## GRAB CHAT MESSAGES AND DISPLAY THEM
if (!$user_level || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";}
$stmt="SELECT * from vicidial_chat_log where chat_id='$chat_id' $user_level_clause order by message_time asc";
echo "<table border='0' cellpadding='3' width='100%'>\n";
$rslt=mysql_to_mysqli($stmt, $link);
while ($row=mysqli_fetch_row($rslt)) {
$chat_color_key=array_search("$row[4]", $chat_members);
$row[2]=preg_replace('/\n/', '<BR/>', $row[2]);
echo "<tr><td bgcolor='$chat_background_array[$chat_color_key]'><li><font color='$color_array[$chat_color_key]' class='chat_message bold'>$row[5]</font> <font class='chat_timestamp bold'>($row[3])</font> - <font class='chat_message ".$style_array[$row[6]]."'>$row[2]</font></li></td></tr>\n";
}
echo "</table>\n";
# $survey_stmt="select customer_chat_survey_link, customer_chat_survey_text from vicidial_inbound_groups where group_id='$group_id'";
# $survey_rslt=mysql_to_mysqli($survey_stmt, $link);
# $survey_row=mysqli_fetch_array($survey_rslt);
# if (strlen($survey_row["customer_chat_survey_link"])>0) {
# echo "<BR><BR><font class='chat_title'><a href='".$survey_row["customer_chat_survey_link"]."' target='_parent'>";
# if (strlen($survey_row["customer_chat_survey_text"])>0) {
# echo $survey_row["customer_chat_survey_text"];
# } else {
# echo _QXZ("PLEASE TAKE OUR SURVEY");
# }
# echo "</a><BR><BR>";
# }
# echo "<font class='chat_title bold'>"._QXZ("You have left chat").": $chat_id.</font>";
# echo "<BR/><BR/><font class='chat_title'><a href='".$chat_url."?group_id=$group_id&language=$language&available_agents=$available_agents&show_email=$show_email' target='_self'>"._QXZ("GO BACK TO CHAT FORM")."</a></font><BR/>\n";
}
} else {
if ($status_row[1]=="NONE") {
echo "<font class='chat_title bold'>"._QXZ("Waiting for next available agent...")."</font><BR/>\n";
# $chat_color_stmt="select menu_background, frame_background, std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background, web_logo from vicidial_inbound_groups vig, vicidial_screen_colors v where vig.group_id='$group_id' and vig.customer_chat_screen_colors=v.colors_id and length(frame_background)=6 and length(menu_background)=6 limit 1;";
# $color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
# $web_logo=""; $filepath="vicidial/images";
# if(mysqli_num_rows($color_rslt)>0) {
# $color_row=mysqli_fetch_array($color_rslt);
# switch ($color_row["web_logo"]) {
# case "default_new":
# $color_row["web_logo"]=".png";
# break;
# case "default_old";
# $color_row["web_logo"]=".gif";
# $filepath="vicidial";
# break;
# }
# $web_logo=$color_row["web_logo"];
# }
# if (!preg_match("/\.(jpg|gif|png|bmp)$/", $web_logo)) {$web_logo.=".png";}
# echo "<table border='0' width='100%'>\n";
# echo "<tr height='48'>\n";
# echo "<td align='left' width='50%' valign='top'>\n";
# echo "<font class='chat_title bold'>"._QXZ("Waiting for next available agent...")."</font><BR/>\n";
$chat_status="<font color='#990'>WAITING</font>";
echo "$chat_status|";
$chat_count_stmt="SELECT chat_id from vicidial_live_chats vlc, vicidial_inbound_groups vig where vlc.status='WAITING' and (vlc.group_id='$group_id' or (vlc.group_id='AGENTDIRECT_CHAT')) and (transferring_agent is null or transferring_agent!='$user') and vlc.group_id=vig.group_id order by queue_priority desc, chat_id asc";
$chat_count_rslt=mysql_to_mysqli($chat_count_stmt, $link);
$people_ahead_of_you=0;
while($chat_count_row=mysqli_fetch_row($chat_count_rslt)) {
if ($chat_count_row[0]!=$chat_id) {
$people_ahead_of_you++;
} else {
break;
}
}
if ($people_ahead_of_you>0) {
echo "<font class='chat_title bold'>There are <font color='#FF0000'>$people_ahead_of_you</font> customer(s) in chat queue ahead of you</font>";
} else {
echo "<font class='chat_title bold' color='#FF0000'>You are the next customer in line</font>";
}
# echo "</td>\n";
# echo "<td align='right' width='50%' valign='top'>\n";
# if (file_exists("../$filepath/vicidial_admin_web_logo$web_logo")) {
# echo "<img class='small_logo' src='/$filepath/vicidial_admin_web_logo$web_logo'>\n";
# } else {
# if (file_exists("./images/vicidial_admin_web_logo$web_logo"))
# {
# echo "<img class='small_logo' src='images/vicidial_admin_web_logo$web_logo'>\n";
# }
# }
# echo "</td>\n";
# echo "</tr>\n</table>\n";
} else {
echo "<font class='chat_title alert'>"._QXZ("SYSTEM ERROR")."</font><BR/>\n";
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

+3
View File
@@ -0,0 +1,3 @@
<?php
$use_agent_colors = '1'; # set to 1 to use the agent_screen_colors setting in the system settings
?>
@@ -17,6 +17,7 @@
# 160108-1700 - Added available_agents, status_link button options and validation of active in-group
# 160120-1925 - Fixed missing list_id on vicidial_list inserts, Issue #915. Added show_email option
# 160203-1052 - Added display of chat message after ending it
# 160805-2315 - Added coding to show logos in customer display
#
require("dbconnect_mysqli.php");
@@ -360,8 +361,42 @@ if ($stage == 'send_request') { # For people requesting a chat with an agent; co
$ins_rslt=mysql_to_mysqli($ins_stmt, $link);
$chat_id=mysqli_insert_id($link);
# WEB LOGO
$chat_color_stmt="select web_logo from vicidial_inbound_groups vig, vicidial_screen_colors v where vig.group_id='$group_id' and vig.customer_chat_screen_colors=v.colors_id limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
$web_logo=""; $filepath="vicidial/images";
if(mysqli_num_rows($color_rslt)>0) {
$color_row=mysqli_fetch_array($color_rslt);
switch ($color_row["web_logo"]) {
case "default_new":
$color_row["web_logo"]=".png";
break;
case "default_old";
$color_row["web_logo"]=".gif";
$filepath="vicidial";
break;
}
$web_logo=$color_row["web_logo"];
}
if (!preg_match("/\.(jpg|gif|png|bmp)$/", $web_logo)) {$web_logo.=".png";}
if ($chat_id>0) {
$survey_stmt="select customer_chat_survey_link, customer_chat_survey_text from vicidial_inbound_groups where group_id='$group_id'";
$survey_rslt=mysql_to_mysqli($survey_stmt, $link);
$survey_row=mysqli_fetch_array($survey_rslt);
if (strlen($survey_row["customer_chat_survey_link"])>0) {
$survey_str="<BR/><BR/><font class='chat_title'><a href='".$survey_row["customer_chat_survey_link"]."' target='_parent'>";
if (strlen($survey_row["customer_chat_survey_text"])>0) {
$survey_str.=$survey_row["customer_chat_survey_text"];
} else {
$survey_str.=_QXZ("PLEASE TAKE OUR SURVEY");
}
$survey_str.="</a>";
}
$ins_stmt="INSERT INTO vicidial_chat_participants(chat_id, chat_member, chat_member_name, ping_date, vd_agent) VALUES('$chat_id', '" . mysqli_real_escape_string($link, $user) . "', '" . mysqli_real_escape_string($link, $chat_member_name) . "', now(), 'N')";
$ins_rslt=mysql_to_mysqli($ins_stmt, $link);
if (mysqli_affected_rows($link)==0) {
@@ -438,6 +473,7 @@ function LeaveChat(chat_id, user, chat_member_name) {
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
document.getElementById('chat_message_console').innerHTML="<BR/><BR/><font class='chat_title'><a href='"+chat_url+"?group_id="+group_id+"&language="+language+"&available_agents="+available_agents+"&show_email="+show_email+"'><?php echo _QXZ("GO BACK TO CHAT FORM") ?></a></font>\n<?php echo $survey_str; ?>";
//if (chat_creator==user) {EndChat();}
}
}
@@ -475,14 +511,26 @@ function UpdateChatWindow() {
var chat_log_response = xmlhttp.responseText;
if (chat_log_response.match(/^Error/))
{
document.getElementById('chat_message_console').innerHTML="<font class='chat_title alert'><?php echo _QXZ("Chat does not exist or has been closed") ?>: "+chat_id+"</font><BR/><BR/><font class='chat_title'><a href='"+chat_url+"?group_id="+group_id+"&language="+language+"&available_agents="+available_agents+"&show_email="+show_email+"'><?php echo _QXZ("GO BACK TO CHAT FORM") ?></a></font>\n";
document.getElementById('chat_message_console').innerHTML="<font class='chat_title alert'><?php echo _QXZ("Chat does not exist or has been closed") ?></font><BR/><BR/><font class='chat_title'><a href='"+chat_url+"?group_id="+group_id+"&language="+language+"&available_agents="+available_agents+"&show_email="+show_email+"'><?php echo _QXZ("GO BACK TO CHAT FORM") ?></a></font>\n<?php echo $survey_str; ?>";
}
var fullchatlog=chat_log_response.replace(/Error\|/, '');
var chatlogresponse=chat_log_response.replace(/Error\|/, '');
var chatlogresponse_ary=chatlogresponse.split("|");
var current_chat_status=chatlogresponse_ary[0];
var fullchatlog=chatlogresponse_ary[1];
document.getElementById('ChatActiveStatus').innerHTML=current_chat_status;
// var fullchatlog=chat_log_response.replace(/Error\|/, '');
document.getElementById('ChatDisplay').innerHTML=fullchatlog;
var current_message_field_update = document.getElementById('current_message_count');
if (current_message_field_update != null) {var current_message_count_update=current_message_field_update.value;}
if (current_message_count_update>current_message_count && !document.getElementById("MuteCustomerChatAlert").checked) {document.getElementById("CustomerChatAudioAlertFile").play();}
if (current_message_count_update>current_message_count)
{
var myDiv = document.getElementById('ChatDisplay');
document.getElementById('ChatDisplay').scrollTop = document.getElementById('ChatDisplay').scrollHeight;
if (!document.getElementById("MuteCustomerChatAlert").checked) {document.getElementById("CustomerChatAudioAlertFile").play();}
}
}
}
delete xmlhttp;
@@ -661,9 +709,37 @@ $chat_title= _QXZ("Request chat with agent"); # This can be modified for customi
<form action='<?php echo $PHP_SELF; ?>' name="chat_form" id="chat_form">
<table width='100%' border='0'>
<tr>
<td class='chat_window' height='250' width='100%'>
<span id='ChatDisplay' name='ChatDisplay' style=" overflow-y: auto; overflow-x: none;">
<td class="chat_window" height='250' width='100%'>
<table border='0' width='100%'>
<tr height='35'>
<td align='left' width='50%' valign='top'>
<font class='chat_title bold'><?php echo _QXZ("Current chat"); ?>: <span id='ChatActiveStatus'><font color='#990'>WAITING</font></span></font>
</td>
<td align='right' width='50%' valign='top'>
<?php
if (file_exists("../$filepath/vicidial_admin_web_logo$web_logo"))
{
echo "<img class='small_logo' src='/$filepath/vicidial_admin_web_logo$web_logo'>\n";
}
else
{
if (file_exists("./images/vicidial_admin_web_logo$web_logo"))
{
echo "<img class='small_logo' src='images/vicidial_admin_web_logo$web_logo'>\n";
}
}
?>
</td>
</tr>
</table>
<span id='ChatDisplay' name='ChatDisplay' style="position:relative;display:block;width:100%;height:215px;overflow-y:auto;overflow-x:none;z-index:0">
</span>
<!--
<span style="position:fixed;display:block;top:230px;right:25px;z-index:1"><img border="0" src="images/VICIchat_powered_logo.gif" width="123" height="30"></span>
<span style="display:inline-block;float:right;z-index:1"><img border="0" src="images/VICIchat_powered_logo.png" width="123" height="30"></span>
//-->
</td>
</tr>
<tr>
@@ -688,6 +764,9 @@ $chat_title= _QXZ("Request chat with agent"); # This can be modified for customi
<input class='red_btn' type='button' style="width:100px" value="<?php echo _QXZ("LEAVE CHAT"); ?>" onClick="LeaveChat(document.getElementById('chat_id').value, document.getElementById('user').value, document.getElementById('chat_member_name').value);">
</td>
</tr>
<tr>
<td align='right' colspan='2'><img border="0" style="padding-top: 5px;" src="images/VICIchat_powered_logo.png" width="123" height="30"></td>
</tr>
</table>
</td>
</tr>
+4 -1
View File
@@ -27,6 +27,7 @@
# 151219-0139 - Added option for searching archived data
# 160121-2214 - Added report title header, default report format, cleaned up formatting
# 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs
# 160718-0054 - Fixed ChartJS bug
#
$startMS = microtime();
@@ -989,7 +990,8 @@ if ( ($SUBMIT=="SUBMIT") or ($SUBMIT==_QXZ("SUBMIT")) )
# You have to hard code the graph name in where it is overridden and mind the data indices. No other way to do it.
$multigraph_text="";
$graph_id++;
$graph_array=array("ATPD_CALLSdata|1|CALLS|integer|", "ATPD_LEADSdata|2|LEADS|integer|", "ATPD_CONTACTSdata|3|CONTACTS|integer|", "ATPD_CONTACTRATIOdata|4|CONTACT RATIO|percent|", "ATPD_SYSTEMTIMEdata|5|SYSTEM TIME|time|", "ATPD_TALKTIMEdata|6|TALK TIME|time|", "ATPD_SALESdata|7|SALES|integer|", "ATPD_SALESTOLEADSdata|8|SALES TO LEADS RATIO|decimal|", "ATPD_SALESTOCONTACTSdata|9|SALES TO CONTACTS RATIO|decimal|", "ATPD_SALESPERHOURdata|10|SALES PER HOUR|decimal|", "ATPD_INCOMPLETESALESSdata|11|INCOMPLETE SALES|integer|", "ATPD_CANCELLEDSALESdata|12|CANCELLED SALES|integer|", "ATPD_CALLBACKSdata|13|CALLBACKS|integer|", "ATPD_FIRSTCALLSdata|14|FIRST CALLS|decimal|", "ATPD_AVGSALETIMEdata|15|AVG SALE TIME|time|", "ATPD_AVGCONTACTTIMEdata|16|AVG CONTACT TIME|time|");
$dataset_ID="_".$user_group[$i]; # VERY IMPORTANT
$graph_array=array("ATPD_CALLSdata$dataset_ID|1|CALLS|integer|", "ATPD_LEADSdata$dataset_ID|2|LEADS|integer|", "ATPD_CONTACTSdata$dataset_ID|3|CONTACTS|integer|", "ATPD_CONTACTRATIOdata$dataset_ID|4|CONTACT RATIO|percent|", "ATPD_SYSTEMTIMEdata$dataset_ID|5|SYSTEM TIME|time|", "ATPD_TALKTIMEdata$dataset_ID|6|TALK TIME|time|", "ATPD_SALESdata$dataset_ID|7|SALES|integer|", "ATPD_SALESTOLEADSdata$dataset_ID|8|SALES TO LEADS RATIO|decimal|", "ATPD_SALESTOCONTACTSdata$dataset_ID|9|SALES TO CONTACTS RATIO|decimal|", "ATPD_SALESPERHOURdata$dataset_ID|10|SALES PER HOUR|decimal|", "ATPD_INCOMPLETESALESSdata$dataset_ID|11|INCOMPLETE SALES|integer|", "ATPD_CANCELLEDSALESdata$dataset_ID|12|CANCELLED SALES|integer|", "ATPD_CALLBACKSdata$dataset_ID|13|CALLBACKS|integer|", "ATPD_FIRSTCALLSdata$dataset_ID|14|FIRST CALLS|decimal|", "ATPD_AVGSALETIMEdata$dataset_ID|15|AVG SALE TIME|time|", "ATPD_AVGCONTACTTIMEdata$dataset_ID|16|AVG CONTACT TIME|time|");
for ($e=0; $e<count($call_status); $e++) {
$Sstatus=$call_status[$e];
@@ -1083,6 +1085,7 @@ if ( ($SUBMIT=="SUBMIT") or ($SUBMIT==_QXZ("SUBMIT")) )
$ASCII_text.=" **** "._QXZ("NO AGENTS FOUND UNDER THESE REPORT PARAMETERS")." ****\n\n";
$CSV_text.="\"\",\"**** "._QXZ("NO AGENTS FOUND UNDER THESE REPORT PARAMETERS")." ****\"\n\n";
$GRAPH_text.=" **** "._QXZ("NO AGENTS FOUND UNDER THESE REPORT PARAMETERS")." ****<BR/><BR/>\n\n";
$total_graph_stats[$i][0]="$user_group[$i] - $group_name";
}
}
+50 -13
View File
File diff suppressed because one or more lines are too long
+17 -1
View File
@@ -93,6 +93,7 @@
# 160621-1735 - Added agent_screen_colors and script_remove_js entries
# 160731-1030 - Added manual_auto_next, manual_auto_show, user_nickname entries
# 160731-2053 - Added POSTx description for recording filenames
# 160809-1351 - Added customer_chat_screen_colors and customer_chat_survey_link/text entries
#
@@ -2804,6 +2805,21 @@ if ($SSqc_features_active > 0)
<BR>
<B><?php echo _QXZ("Uniqueid Status Prefix"); ?> -</B><?php echo _QXZ("If PREFIX option is selected above then this is the value of that prefix. Default is empty."); ?>
<BR>
<A NAME="inbound_groups-customer_chat_screen_colors">
<BR>
<B><?php echo _QXZ("Customer Chat Screen Colors"); ?> -</B><?php echo _QXZ("This option allows you to select the colors and logo that the customer will see when they use the chat screen. default is the default blue color scheme."); ?>
<BR>
<A NAME="inbound_groups-customer_chat_survey_link">
<BR>
<B><?php echo _QXZ("Customer Chat Survey Link"); ?> -</B><?php echo _QXZ("This option allows you to define a link that the customer can go to after their chat session is over so that they can take a survey. If no link is defined then the customer will not be presented with a link. default is the empty."); ?>
<BR>
<A NAME="inbound_groups-customer_chat_survey_text">
<BR>
<B><?php echo _QXZ("Customer Chat Survey Text"); ?> -</B><?php echo _QXZ("If the Survey Link above is populated, then this field can be used to define the text that is shown to the customer for them to click on to go to the survey link. default is the empty, in which case -PLEASE TAKE OUR SURVEY- will be used."); ?>
<BR>
<A NAME="inbound_groups-populate_lead_ingroup">
<BR>
@@ -3506,7 +3522,7 @@ if ($SSqc_features_active > 0)
<BR>
<A NAME="scripts-script_text">
<B><?php echo _QXZ("Script Text"); ?> -</B><?php echo _QXZ("This is where you place the content of an agent screen Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using --A--field--B-- where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id, user_group, called_count, TABLEper_call_notes. For example, this sentence would print the persons name in it----<BR><BR> 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?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:"); ?>
<B><?php echo _QXZ("Script Text"); ?> -</B><?php echo _QXZ("This is where you place the content of an agent screen Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using --A--field--B-- where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id, call_id, user_group, called_count, TABLEper_call_notes, MANUALDIALLINK. For example, this sentence would print the persons name in it----<BR><BR> 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?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:"); ?>
<DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example>
&#60;iframe src="http://www.sample.net/test_output.php?lead_id=--A--lead_id--B--&#38;vendor_id=--A--vendor_lead_code--B--&#38;list_id=--A--list_id--B--&#38;gmt_offset_now=--A--gmt_offset_now--B--&#38;phone_code=--A--phone_code--B--&#38;phone_number=--A--phone_number--B--&#38;title=--A--title--B--&#38;first_name=--A--first_name--B--&#38;middle_initial=--A--middle_initial--B--&#38;last_name=--A--last_name--B--&#38;address1=--A--address1--B--&#38;address2=--A--address2--B--&#38;address3=--A--address3--B--&#38;city=--A--city--B--&#38;state=--A--state--B--&#38;province=--A--province--B--&#38;postal_code=--A--postal_code--B--&#38;country_code=--A--country_code--B--&#38;gender=--A--gender--B--&#38;date_of_birth=--A--date_of_birth--B--&#38;alt_phone=--A--alt_phone--B--&#38;email=--A--email--B--&#38;security_phrase=--A--security_phrase--B--&#38;comments=--A--comments--B--&#38;user=--A--user--B--&#38;campaign=--A--campaign--B--&#38;phone_login=--A--phone_login--B--&#38;fronter=--A--fronter--B--&#38;closer=--A--user--B--&#38;group=--A--group--B--&#38;channel_group=--A--group--B--&#38;SQLdate=--A--SQLdate--B--&#38;epoch=--A--epoch--B--&#38;uniqueid=--A--uniqueid--B--&#38;customer_zap_channel=--A--customer_zap_channel--B--&#38;server_ip=--A--server_ip--B--&#38;SIPexten=--A--SIPexten--B--&#38;session_id=--A--session_id--B--&#38;dialed_number=--A--dialed_number--B--&#38;dialed_label=--A--dialed_label--B--&#38;rank=--A--rank--B--&#38;owner=--A--owner--B--&#38;phone=--A--phone--B--&#38;camp_script=--A--camp_script--B--&#38;in_script=--A--in_script--B--&#38;script_width=--A--script_width--B--&#38;script_height=--A--script_height--B--&#38;recording_filename=--A--recording_filename--B--&#38;recording_id=--A--recording_id--B--&#38;user_custom_one=--A--user_custom_one--B--&#38;user_custom_two=--A--user_custom_two--B--&#38;user_custom_three=--A--user_custom_three--B--&#38;user_custom_four=--A--user_custom_four--B--&#38;user_custom_five=--A--user_custom_five--B--&#38;preset_number_a=--A--preset_number_a--B--&#38;preset_number_b=--A--preset_number_b--B--&#38;preset_number_c=--A--preset_number_c--B--&#38;preset_number_d=--A--preset_number_d--B--&#38;preset_number_e=--A--preset_number_e--B--&#38;preset_number_f=--A--preset_number_f--B--&#38;preset_dtmf_a=--A--preset_dtmf_a--B--&#38;preset_dtmf_b=--A--preset_dtmf_b--B--&#38;did_id=--A--did_id--B--&#38;did_extension=--A--did_extension--B--&#38;did_pattern=--A--did_pattern--B--&#38;did_description=--A--did_description--B--&#38;closecallid=--A--closecallid--B--&#38;xfercallid=--A--xfercallid--B--&#38;agent_log_id=--A--agent_log_id--B--&#38;entry_list_id=--A--entry_list_id--B--&#38;call_id=--A--call_id--B--&&#38;user_group=--A--user_group--B--&&#38;" 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"&#62;