<%@ page language="C#" autoeventwireup="true" inherits="fjhb0, App_Web_l2p10xlz" %>

<!DOCTYPE html>
<html lang="en">
<head>

    <title>计划调整-<%Response.Write(titlestr);%></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <meta http-equiv="Content-Language" content="zh-CN" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,
                initial-scale=1.0,
                minimum-scale=1.0,
                maximum-scale=1.0,
                user-scalable=no" />
    <script src="/content/js/jquery-2.1.5.min.js" type="text/javascript"></script>
    <script src="/content/layer/layer.js" type="text/javascript"></script>
    <script type="text/javascript">
        layer.config({
            extend: "extend/layer.ext.js"
        });
    </script>

    <!-- Bootstrap -->
    <link href="/content/css/bootstrap.css" rel="stylesheet" />

    <link href="/content/css/custom.min.css" rel="stylesheet" />
    <link href="/content/css/contextMenu.css" rel="stylesheet" />
    <link rel="stylesheet" href="/content/font/iconfont.css" />
    <link rel="stylesheet" href="/content/css/main.css" />
    <script src="/content/js/contextMenu.js" type="text/javascript"></script>
    <script src="/content/js/xggbf.js" type="text/javascript"></script>

</head>
<body>
    <!-- 左侧菜单内容 -->
    <%Response.Write(tempnavmenu); %>
    <!-- 左侧菜单内容结束 -->
    <form runat="server">

        <!-- 右页面内容 -->
        <div class="bg-danger pagebody">
            <div class="right_col" role="main" style="min-height: 880px">
                <div class="page-title">
                    <div class="title_left">
                        <h3>计划调整</h3>

                        <%-- 单教室的计划调整0--%>
                    </div>
                </div>
                <div class="clearfix"></div>
                <!--替换内容-->

                <div class="row">
                    <div class="clearfix"></div>
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <!--计划调整-->
                        <input type="hidden" id="act" name="act" value="<%Response.Write(WebAct); %>" />
                        <input type="hidden" id="fidxid" name="fidxid" value="<%Response.Write(fidxid); %>" />
                        <div class="x_content">
                            <table class="table table-bordered" style="text-align: center; width: 99%;">
                                    <tr>
                                        <td  style="text-align: center; vertical-align: middle; font-weight: normal">
                                            <div class="col-md-12 col-sm-12 col-xs-12" style="text-align: left">
                                                <asp:Button ID="Button1" runat="server" class="btn btn-primary" Text="未来计划列表" OnClick="Button1_Click" />
                                                  <asp:Button ID="Button2" runat="server" class="btn btn-primary" Text="历史计划列表" OnClick="Button2_Click" />
                                            </div>
                                        </td>
                                    </tr>
                                <tr>
                                    <td >
                                        <table class="table table-bordered table-table" style="text-align: center; width: 98%; margin: 15px auto">
                                            <tr>
                                                <%-- <td colspan="9" style="text-align:center"><%Response.Write(tabletitle); %> </td>--%>
                                                <th colspan="9" style="text-align: center"><%Response.Write(tabletitle); %></th>
                                            </tr>
                                            <tr>
                                                <td style="width: 5%;"></td>
                                                <td style="width: 8%;">节次</td>
                                                <td>星期一</td>
                                                <td>星期二</td>
                                                <td>星期三</td>
                                                <td>星期四</td>
                                                <td>星期五</td>
                                                <td>星期六</td>
                                                <td>星期日</td>
                                            </tr>
                                            <%Response.Write(retustr); %>
                                        </table>

                                    </td>
                                </tr>
                            </table>
                        </div>
                        <!--计划表查看-->
                    </div>
                </div>

            </div>
        </div>
    </form>
    <!-- 右页面内容完成 -->
    <!-- 版权内容 -->
    <% Response.Write(copystr);%>
    <!-- 版权内容完成 -->
    <script src="/content/js/zmain.js" charset="utf-8" type="text/javascript"></script>
    <a href="#top"><span id="tophovertree" title="返回顶部"></span></a>
    <script type="text/javascript" src="/content/js/topHovertree.js"></script>
    <script type="text/javascript">
        $(function () { initTopHoverTree("tophovertree", 500, 30, 20); })
    </script>
</body>
</html>


<!-- 弹窗-->
<div id="jsAddUser" class="modal fade bs-example-modal-lg in" tabindex="-1" role="dialog" aria-hidden="true" style="margin-top: 70px; padding-right: 17px;">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="padding: 15px">
            <div class="modal-header">
                <button type="button" onclick="cansleAdd()" class="close" data-dismiss="modal">
                    <span aria-hidden="true">×</span>
                </button>
                <h2 class="modal-title" id="jswintitle">添加</h2>
            </div>
            <form class="form-horizontal form-label-left" novalidate="" style="margin-top: 20px">
                <div id="JS_div" runat="server"></div>
                <input type="hidden" name="id" id="id" value="0" />

                <div class="item form-group bad">
                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">教师</label>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                        <%Response.Write(fvyhgh); %>
                    </div>
                </div>

                <div class="ln_solid"></div>
                <div class="form-group">
                    <div class="col-md-6 col-md-offset-3">
                        <button type="button" onclick="javascript: return ZSEND();" class="btn btn-primary">确定</button>
                        <button onclick="cansleAdd()" type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- 弹窗-->
<script type="text/javascript">
    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);

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

    function ZSEND() {
        var week_no = $(cur_ele).closest("tr").attr("week_no");
        var class_no = $(cur_ele).attr("class_no");
        var week = $(cur_ele).attr("week");
        var title = $(cur_ele).attr("title");
        var fvyhgh = $("#fvyhgh").val();
        var var1 = "beduajax.aspx?ACT=E60340156C06448A87A31CF4D803622D&fidxid=" + $("#fidxid").val() + "&firyid=" + fvyhgh + "&fvrqbm=" + title + "&fijcxh=" + class_no + "&fidxsl=0";
        var temptext = "";
        var1 = encodeURI((var1));
        //alert(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) {
                        var mao = week_no - 2;
                        var cur_id = "#tr" + mao + "_0";
                        var length = location.href.indexOf("#");
                        location.href = location.href.substr(0, length) + cur_id;
                        location.reload();
                        //window.location.reload();
                    }
                    return true;
                });
            }
        });

    }

    var cur_ele;
    function UseLession(week_no, class_no, title, act) {
        //title =20180126 
        //class_no =节次0-4
        //week=星期几  1-7
        //week_no=21 周
        //alert(week_no);
        //return true;
        var var1 = "beduajax.aspx?ACT=" + act + "&fidxid=" + $("#fidxid").val() + "&fvrqbm=" + title + "&fijcxh=" + class_no;
        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) {
                        var mao = week_no - 2;
                        var cur_id = "#tr" + mao + "_0";
                        var length = location.href.indexOf("#");
                        location.href = location.href.substr(0, length) + cur_id;
                        location.reload();
                    }
                    return true;
                });
            }
        });

    }


    $(function () {
        $("#fidxid").change(function () {
            window.location.href = "/fjhb0.aspx?dxid=" + $("#fidxid").val();
        });

        ////jshas_use 
        $(".jshas_use").contextMenu({
            fontSize: 14, // 字体大小
            target: function (ele) {// 当前元素
                cur_ele = ele;
            },
            menu: [{ // 菜单项  458A1A5D1C9A5994771B54AA4D72C077   fjhb1yhyy
                text: "删除",
                icon: "/content/images/close_32.png",
                callback: function () {

                    layer.confirm('确认要删除吗？', {
                        icon: 3, btn: ['确定', '取消'] //按钮
                    }, function () {
                        var week_no = $(cur_ele).closest("tr").attr("week_no");
                        var class_no = $(cur_ele).attr("class_no");
                        var week = $(cur_ele).attr("week");
                        var title = $(cur_ele).attr("title");
                        UseLession(week_no, class_no, title, "627C0C9824E2411F419D17D5C505E70E");
                    });
                },
            }]
        });
        ////jshas_use
        ///jsuse
        $(".jsuse").contextMenu({
            fontSize: 14, // 字体大小
            target: function (ele) {// 当前元素
                cur_ele = ele;
            },
            menu: [{ // 菜单项  images/1.png/content/images/1.png
                text: "指定",
                icon: "/content/images/user_32.png",
                callback: function () {
                    var week_no = $(cur_ele).closest("tr").attr("week_no");
                    var class_no = $(cur_ele).attr("class_no");
                    var week = $(cur_ele).attr("week");
                    var title = $(cur_ele).attr("title");
                    // UseLession(week_no, class_no, title, "E60340156C06448A87A31CF4D803622D");
                    //指定时打开层
                    addUser('指定人员', '0');
                },
            },
                { // 菜单项  458A1A5D1C9A5994771B54AA4D72C077   fjhb1yhyy
                    text: "禁用",  //已经有用户的指定
                    icon: "/content/images/locked_32.png",
                    callback: function () {
                        var week_no = $(cur_ele).closest("tr").attr("week_no");
                        var class_no = $(cur_ele).attr("class_no");
                        var week = $(cur_ele).attr("week");
                        var title = $(cur_ele).attr("title");
                        UseLession(week_no, class_no, title, "3E5A1BA9862A0263A99D471E65FFFD28");
                    },
                }]
        });
        ///jsuse
        ///jsuse

        ////jsno_use
        $(".jsno_use").contextMenu({
            fontSize: 14, // 字体大小
            target: function (ele) {// 当前元素
                cur_ele = ele;
            },
            menu: [{ // 菜单项  458A1A5D1C9A5994771B54AA4D72C077   fjhb1yhyy
               // text: "启用",
               // icon: "/content/images/close_32.png",
                text: "启用",
                icon: "/content/images/unlocked_32.png",
                callback: function () {
                    var week_no = $(cur_ele).closest("tr").attr("week_no");
                    var class_no = $(cur_ele).attr("class_no");
                    var week = $(cur_ele).attr("week");
                    var title = $(cur_ele).attr("title");
                    UseLession(week_no, class_no, title, "631B3C387966B829BD444AE5CCAC4CDF");
                }
            }]
        });
        ////jsno_use
    });
</script>


