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

<!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 gridlist;
        $(function () {
            LoadList();
        });
        function LoadList() {
            gridlist = $("#divDataList").ligerGrid({
                height: '100%',
                columns: [
                { display: '电话号码', name: '_callnumber', minWidth: 60 },
                { display: '呼叫方向', name: '_calltype', minWidth: 50, render: function (rowdata, rowindex, value) {
                    if (value == "0")
                        return "呼入";
                    else
                        return "呼出";
                }
                },
                { display: '呼叫状态', name: '_callstate', minWidth: 50, render: function (rowdata, rowindex, value) {
                    if (value == "0")
                        return "未接通";
                    else
                        return "已接通";
                }
                },
                { display: '通话开始时间', name: '_talkstarttime', minWidth: 130, type: 'date', format: 'yyyy-MM-dd hh:mm:ss' },
                { display: '通话时长(s)', name: '_talklongtime'}], url: 'ajax/telrecords.ashx?action=getlist&telnum=', pageSize: 8, rownumbers: true,
                onSelectRow: function (rowdata, rowid, rowobj) { parent.SetTelphone(rowdata._callnumber); }
            });
            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 deleteRow() {
            g.deleteSelectedRow();
        }
        function cleartextbox() {
            document.getElementById("txtTelphone").value = "";
            document.getElementById("txtstate").value = "";
            document.getElementById("txtzuowei").value = "";
            document.getElementById("txtstarttime").value = "";
            document.getElementById("txtendtime").value = "";
        }
    </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" style=" float:left;">
                    电话号码：<asp:TextBox ID="txtTelphone" runat="server" CssClass="txtInput" Width="80px" ></asp:TextBox>&nbsp;&nbsp; 
                    呼叫状态：<asp:DropDownList ID="ddltstate" runat="server" CssClass="selectBox" Width="80px">
                          <asp:ListItem>全部</asp:ListItem>
                        <asp:ListItem>已接通</asp:ListItem>
                        <asp:ListItem>未接通</asp:ListItem>
                    </asp:DropDownList>&nbsp;&nbsp;                         
                <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="LoadList();" />&nbsp;&nbsp;
                <input id="btnMore" type="button" value="重 置" class="btnSearch" onclick="cleartextbox();" />
            </div>
        </div>
    </div>
    <div id="divDataList">
    </div>
    </form>
</body>
</html>
