<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="qcmanage.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.qualitymanage.qcmanage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="../scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <link href="../scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/core/base.js" type="text/javascript"></script>
    <script src="../scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
    <link href="../scripts/ui/skins/Tab/css/tab.css" rel="stylesheet" type="text/css" />
    <link href="../scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/ui/js/plugins/ligerGrid.js" type="text/javascript"></script>
    <script src="../scripts/CustomersData.js" type="text/javascript"></script>
    <link href="../scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="../images/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        var strWhere = "";
        function OpenWindowShow1(Url, Title, Width, Height) {
            $.ligerDialog.open({ title: Title, isHidden: false, url: Url, height: Height, width: Width, isResize: true, modal: true, buttons: [
                { text: '关闭', onclick: function (item, dialog) { dialog.close(); } }
             ], isResize: true
            });
        }
        function Player(id,state, path) {
//            //OpenWindowShow1('voiceplay.aspx?path=' + path, '录音播放与下载', 600, 300);
//            if (state == "1") {
//                $.ligerDialog.error('该记录已质检');
//            }
//            else {
                var vheight = $("#form1").height() - 30;
                var vwidth = $("#form1").width() * 0.9;
                if (vwidth > 700) {
                    vwidth = 700;
                }
                var vtitle = "录音播放下载及质检";
                $.ligerDialog.open({ url: 'qcedit.aspx?otype=qcedit&id=' + id + '&path=' + path, title: vtitle, height: vheight, width: vwidth, isResize: true
                });
//            }
        }

        function itemclick(item) {
            alert(item.text);
        }
        var gridlist;
        $(function () {
            LoadList();
        });
        function CallOut(phone) {
            parent.PhoneCallOut(1, phone);
        }
        function ReLoadList() {
            gridlist.reload();
        }
        function LoadList() {
            gridlist = $("#divDataList").ligerGrid({
                height: '100%',
                columns: [
                { display: '电话号码', name: '_callnumber', width: 100, frozen: true },
                 { display: '录音质检', name: '_filepath', width: 60, frozen: true, render: function (rowdata, rowindex, value) {
                     if (value == "") {
                         return;
                     }
                     else {
                         return "<img src=\"../images/notice.png\" style=\"cursor:hand;\" onclick=\"Player('" + rowdata._callrecordsid + "','" + rowdata._f_qcstate + "','" + encodeURI(value) + "');\" />";
                     }
                 }
                 },
                 { display: '是否质检', name: '_f_qcstate', width: 80, frozen: true, render: function (rowdata, rowindex, value) {
                     if (value == "0")
                         return "<font color='red'>未质检</font>";
                     else if (value == "1")
                         return "<font color='blue'>已质检</font>";
                     else
                         return "<font color='red'>未质检</font>";
                 }
                 }, { display: '质检得分', name: '_f_qcscore', width: 60, frozen: true },
                { display: '呼叫方向', name: '_calltype', width: 80, frozen: true, render: function (rowdata, rowindex, value) {
                    if (value == "0")
                        return "呼入";
                    else
                        return "呼出";
                }
                },
                { display: '呼叫状态', name: '_callstate', width: 80, frozen: true, render: function (rowdata, rowindex, value) {
                    if (value == "0")
                        return "未接通";
                    else
                        return "已接通";
                }
                }, { display: '坐席工号', name: '_usercode', width: 80 },
                { display: '坐席姓名', name: '_username', width: 80 },
                { display: '通话开始时间', name: '_talkstarttime', width: 130, type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                { display: '通话结束时间', name: '_talkendtime', width: 130, type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                { display: '通话时长(s)', name: '_talklongtime', width: 80 },
                 { display: '按键', name: '_businesstype', width: 50}], url: 'ajax/qcmanage.ashx?action=getlist' + strWhere, pageSize: 20, pageSizeOptions: [10, 20, 50], rownumbers: true
            });
            gridlist.changePage('first');
            $("#pageloading").hide();
        }
        function formatDateTime(value, rowData, rowIndex) {
            if (value != null) {
                var date = new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
                var result = date.getFullYear() + "-" + (date.getMonth() + 1 < 10 ? "0"
                    + (date.getMonth() + 1) : date.getMonth() + 1) + "-"
                    + (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " "
                    + (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":"
                    + (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":"
                    + (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
                return result;
            }
            return value;
        }
        function cleartextbox() {
            document.getElementById("txtTelphone").value = "";
            document.getElementById("txtstate").value = "";
            document.getElementById("txtzuowei").value = "";
            document.getElementById("txtstarttime").value = "";
            document.getElementById("txtendtime").value = "";
        }
        function getparams(params) {
            strWhere = "";
            if (params != "") {
                strWhere += params;
            }
            LoadList();
        }
        function getsql() {
            strWhere = "";
            var phone = document.getElementById("txtTelphone").value;
            var account = document.getElementById("ddlAccount").value;
            if (phone != "") {
                strWhere += "&phone=" + phone + "";
            }
            if (account != "") {
                strWhere += "&usercode=" + account + "";
            }
            LoadList();
        }
        function HighSearch() {
            $.ligerDialog.open({
                url: '../telmanage/recordhighsearch.aspx',
                title: '高级搜索',
                height: 300,
                width: 600,
                isResize: true
            });
        }
        document.onkeydown = function (event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];
            if (e && e.keyCode == 13) {
                getsql();
            }
        };
    </script>
</head>
<body style="margin: 0px; padding: 0px; overflow: hidden;">
    <form id="form1" runat="server">
    <div class="l-loading" style="display: block" id="pageloading">
    </div>
    <div class="tools_box">
        <div class="tools_bar">
            <div class="search_box">
                    电话号码：<asp:TextBox ID="txtTelphone" runat="server" CssClass="txtInput" Width="80px"></asp:TextBox>&nbsp;&nbsp;
                    坐席： <asp:DropDownList ID="ddlAccount" runat="server" CssClass="selectBox" Width="70px"> </asp:DropDownList>&nbsp;&nbsp;
                <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="getsql();" />&nbsp;&nbsp;
                <input id="btnHighSearch" type="button" value="高级搜索" class="btnSearch" onclick="HighSearch();" />
            </div>
        </div>
    </div>
    <div id="divDataList">
    </div>
    </form>
</body>
</html>

