
var layer_index;
function addUser(title, id) {
    $("#jswintitle").html(title);
    layer_index = layer.open({
        type: 1,
        title: false,
        closeBtn: 0,
        shift: false,
        content: $("#jsAddUser"),
    });
    $("#id").val(id);
    //如果是新增
    if (id == "0")
    { $("#fvxxsm").val("无"); }
    else
    {//是修改，调用getuser()
        getuser(id);
    }
}
//AJAX读取USER信息
function getuser(id) {

    var1 = "beduajax.aspx?ACT=6DDF13E62088BCCBD9DB13838248B10A&id=" + id;
    var temptext = "";
    var1 = encodeURI((var1));
    $.ajax({
        type: "Post",
        url: var1,
        data: { data1: '13D17C93EDB', },
        cache: false,
        contentType: "application/x-www-form-urlencoded;?charset=UTF-8",
        success: function (temptext) {
            var arr = new Array();
            arr = temptext.split("|");
            $("#fvxymc").val(arr[0]);
            $("#fvzymc").val(arr[1]);
            $("#fvzydm").val(arr[2]);

            $("#fixlcc").val(arr[3]);

            $("#fvkcmc").val(arr[4]);
            $("#fvkcdm").val(arr[5]);
            $("#fvxsbj").val(arr[6]);

            $("#fixsrs").val(arr[7]);
            $("#fizkss").val(arr[8]);
            $("#fisyks").val(arr[9]);

            $("#fvxxsm").val(arr[10]);
        }
    });

   
}


//关闭弹出
function cansleAdd() {
    layer.close(layer_index);
    clearWin();
}
//清除窗体中内容
function clearWin() {
    $("#jsAddUser").find("input").each(function () {
        $(this).val("");
    });
}

//发送AJAX
function Zsend(var1) {

    temptext = var1;
    layer.msg(temptext, { icon: 1, btn: ['确定'] }, function () {
        if (temptext.indexOf("成功") > -1) {
            window.location.reload();
        }

        return true;
    });
}

function ZALLRZ() {// 全部记录
    window.location.href = "dkcxz.aspx";
}

function ZJLCX() {// 条件查询
    var fvxymc = "";
    var fvkcmc = "";
    var firyid = "";

    if (document.getElementById("fvxymc").value != "0")
    { fvxymc = document.getElementById("fvxymc").value; }

    if (document.getElementById("fvkcmc").value != "")
    { fvkcmc = document.getElementById("fvkcmc").value; }

    if (document.getElementById("firyid").value != "0")
    { firyid = document.getElementById("firyid").value; }

    window.location.href = "dkcxz.aspx?fvxymc=" + fvxymc + "&fvkcmc=" + fvkcmc + "&firyid=" + firyid;
}


function ZDELESELE(id) {
    layer.confirm('确认要删除吗？', {
        icon: 3, btn: ['确定', '取消'] //按钮
    }, function () {
        temp = ZQDdele(id);
    });
}

function ZQDdele(id) {//删除选择
    var1 = "beduajax.aspx?ACT=3E405E29851383390E437DA0562272A5&id=" + id;
    var temptext = "";
    var1 = encodeURI((var1));
    $.ajax({
        type: "Post",
        url: var1,
        data: { data1: '13D17C93EDB', },
        cache: false,
        contentType: "application/x-www-form-urlencoded;?charset=UTF-8",
        success: function (temptext) {
            layer.msg(temptext, { icon: 1, btn: ['确定'] }, function () {
                if (temptext.indexOf("成功删除课程信息") > -1) {
                    window.location.reload();
                }
                return true;
            });
        }
    });
  

}
