You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
235 lines
7.8 KiB
235 lines
7.8 KiB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<HEAD>
|
|
<TITLE>后台管理</TITLE>
|
|
<link href="/js/layout/jquery.layout.css" rel="stylesheet" type="text/css">
|
|
<link href="/js/jqueryui/css/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css">
|
|
</HEAD>
|
|
<BODY>
|
|
<DIV id="container" class="ui-layout-center" style="padding: 0px; overflow: hidden;">
|
|
<div id="tabs" style="border: 0; padding: 0px; margin: 0px;">
|
|
<ul>
|
|
<li><a href="#tabs-1">首页</a></li>
|
|
</ul>
|
|
<div id="tabs-1" style="overflow: hidden;">
|
|
<div style="position: absolute; left: 50px; right: 50px; width: 900px; height: 300px;">
|
|
<!--
|
|
<object id="axDRSLC" classid="clsid:F47CFBF8-18A5-4620-9A7E-0E96B118D94A" height="300" width="900"></object>
|
|
//-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</DIV>
|
|
<DIV class="ui-layout-north" style="padding: 0px; overflow: hidden;">
|
|
<iframe src="/common/top" frameborder="0" width="100%" height="59" scrolling="no"></iframe>
|
|
</DIV>
|
|
<DIV class="ui-layout-west" style="padding: 0px; overflow: hidden;">
|
|
<iframe src="/common/left" frameborder="0" width="190" height="100%" scrolling="auto"></iframe>
|
|
</DIV>
|
|
<SCRIPT type="text/javascript" src="/js/jquery-1.8.3.js"></SCRIPT>
|
|
<SCRIPT type="text/javascript" src="/js/jqueryui/jquery-ui-1.9.2.custom.min.js"></SCRIPT>
|
|
<SCRIPT type="text/javascript" src="/js/layout/jquery.layout.js"></SCRIPT>
|
|
<SCRIPT type="text/javascript">
|
|
var tabs;
|
|
function openTab(node) {
|
|
var label=node.name,id=node.id;
|
|
var index = tabs.find('li#tabs-'+id).index();
|
|
if(index == -1) {
|
|
li = '<li id="tabs-'+id+'"><a href="#' + id + '">' + label + '</a><span class="ui-icon ui-icon-close" role="presentation">删除</span></li>',
|
|
tabContentHtml = '<iframe src="' + node.path + '" frameborder="0" width="100%" height="100%" scrolling="auto"></iframe>';
|
|
var a = tabs.find( ".ui-tabs-nav" ).append( li );
|
|
tabs.append('<div id="' + id + '" style="overflow: hidden; padding: 0px;">' + tabContentHtml + '</div>');
|
|
tabs.tabs( "refresh" );
|
|
}
|
|
tabs.tabs("option","active",index);
|
|
}
|
|
|
|
var g_has_phone = false;
|
|
var strFJH = "<?=$this->context->my->ext_phone?>"; //分机号
|
|
|
|
function test() {
|
|
alert('test');
|
|
}
|
|
|
|
function CallPhone()
|
|
{
|
|
var phone = $('#phone').val();
|
|
drtCall(phone);
|
|
}
|
|
|
|
function drtLogin()
|
|
{
|
|
if(!g_has_phone) return;
|
|
n = document.all.axDRSLC.drtLogin("人工","<?=$this->context->my->ext_phone?>","<?=$this->context->my->ext_phone?>","123");
|
|
if (n == 1){
|
|
}
|
|
else {
|
|
alert("发送签入指令失败");
|
|
}
|
|
window.setTimeout("drtAgentType()",3000);
|
|
}
|
|
|
|
function drtLogout()
|
|
{
|
|
if(!g_has_phone) return;
|
|
n = document.all.axDRSLC.drtLogout("人工","<?=$this->context->my->ext_phone?>");
|
|
if (n == 1){
|
|
// alert("发送签出指令成功");
|
|
}
|
|
else alert("发送签出指令失败");
|
|
}
|
|
|
|
function drtAgentType()
|
|
{
|
|
if(!g_has_phone) return;
|
|
strSLCType=1;
|
|
var n = document.all.axDRSLC.drtSetAgentType(parseInt(strSLCType));
|
|
if (n == 1){
|
|
// alert("发送设置座类型指令成功。" + strSLCType);
|
|
}
|
|
else alert("发送设置座类型指令失败。");
|
|
}
|
|
|
|
function drtCall(strCallee)
|
|
{
|
|
if(!g_has_phone) return;
|
|
var n = document.all.axDRSLC.drtAutoDial(101,1,"801",strCallee);
|
|
if (n == 1)
|
|
{
|
|
// alert("发送呼叫[" + strCallee + "]指令成功");
|
|
}
|
|
else{alert("发送呼叫[" + strCallee + "]指令失败");}
|
|
}
|
|
function drtHook()
|
|
{
|
|
if(!g_has_phone) return;
|
|
n = document.all.axDRSLC.drtHook("801");
|
|
if (n == 1)
|
|
{
|
|
// alert("发送软挂机指令成功");
|
|
}
|
|
else
|
|
{
|
|
alert("发送软挂机指令失败");
|
|
}
|
|
}
|
|
|
|
function funload()
|
|
{
|
|
|
|
try
|
|
{
|
|
recivePacket();
|
|
var objaxDRSLC = document.getElementById('axDRSLC');
|
|
objaxDRSLC.drtSetStartParam("<?=$this->context->my->phoneServer?$this->context->my->phoneServer->ip:''?>", 9558);
|
|
objaxDRSLC.drtSetLoginParam("人工", strFJH, strFJH, "123");
|
|
objaxDRSLC.drtSetAutoDialParam(1, 1);
|
|
objaxDRSLC.drtSetAgentType(1);
|
|
|
|
var strCurVersion=document.all.axDRSLC.GetVerson();
|
|
// 设置座席姓名
|
|
objaxDRSLC.drtSetXingMinParam("<?=$this->context->my->getShowName()?>");
|
|
g_has_phone = true;
|
|
}
|
|
catch(e)
|
|
{
|
|
g_has_phone = false;
|
|
// alert('加载控件失败。');
|
|
}
|
|
}
|
|
// 启动数据接收 1ms接收一次 --- 此处要特别注意
|
|
function recivePacket()
|
|
{
|
|
if(!g_has_phone) {
|
|
window.setTimeout("recivePacket()",1);
|
|
return;
|
|
}
|
|
document.all.axDRSLC.drtRecivePacket();
|
|
window.setTimeout("recivePacket()",1);
|
|
|
|
}
|
|
var g_phone_id=0;
|
|
var g_phone_state = 0;
|
|
var g_count = 0;
|
|
//应答事件
|
|
function eventOffHook(vStrCaller) {
|
|
if(vStrCaller == strFJH) {
|
|
$.post('/phone-server/phone-begin',{caller:vStrCaller,phone_id:g_phone_id},function(obj){
|
|
if(obj.success) {
|
|
g_count++;
|
|
g_phone_id = obj.phone_id;
|
|
bTimer = true;
|
|
}
|
|
},'json');
|
|
}
|
|
}
|
|
//挂机事件
|
|
function eventHook(vStrCaller) {
|
|
if(vStrCaller == strFJH) {
|
|
if(g_phone_id > 0 && g_count > 0) {
|
|
g_count = 0;
|
|
$.post('/phone-server/phone-end',{caller:vStrCaller,phone_id:g_phone_id},function(obj){
|
|
if(obj.success) {
|
|
g_phone_id = 0;
|
|
}
|
|
},'json');
|
|
}
|
|
}
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
$('body').layout({
|
|
north__size:59,
|
|
west__size:175,
|
|
north__spacing_open:0,
|
|
west__spacing_open:0
|
|
});
|
|
tabs = $( "#tabs" ).tabs({ heightStyle: "fill" });
|
|
|
|
tabs.on( "click", "span.ui-icon-close", function() {
|
|
var panelId = $( this ).closest( "li" ).remove().attr( "aria-controls" );
|
|
$( "#" + panelId ).remove();
|
|
tabs.tabs( "refresh" );
|
|
});
|
|
|
|
tabs.on( "keyup", function( event ) {
|
|
if ( event.altKey && event.keyCode === $.ui.keyCode.BACKSPACE ) {
|
|
var panelId = tabs.find( ".ui-tabs-active" ).remove().attr( "aria-controls" );
|
|
$( "#" + panelId ).remove();
|
|
tabs.tabs( "refresh" );
|
|
}
|
|
});
|
|
//初始化软电话
|
|
funload();
|
|
});
|
|
//收到忙音事件
|
|
function eventBusyVoice(vStrCaller)
|
|
{
|
|
if (vStrCaller == strFJH)
|
|
{
|
|
if(g_phone_id > 0) {
|
|
g_count = 0;
|
|
$.post('/phone-server/phone-end',{caller:vStrCaller,phone_id:g_phone_id},function(obj){
|
|
if(obj.success) {
|
|
g_phone_id = 0;
|
|
}
|
|
},'json');
|
|
}
|
|
}
|
|
}
|
|
|
|
</SCRIPT>
|
|
<script language="javascript" type="text/javascript" For="axDRSLC" event="drtAnswerEvent(vStrCaller)">
|
|
//应签
|
|
eventOffHook(vStrCaller);
|
|
</script>
|
|
<script language="javascript" type="text/javascript" For="axDRSLC" event="drtHookEvent(vStrCaller)">
|
|
//挂机
|
|
eventHook(vStrCaller);
|
|
</script>
|
|
<script language="javascript" type="text/javascript" For="axDRSLC" event="drtBusyVoiceEvent(vCallerID)">
|
|
//忙音
|
|
eventBusyVoice(vCallerID);
|
|
</script>
|
|
</BODY>
|
|
</HTML> |