<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SimonMasterPage.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Html.Language("HostManagement") %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'north',border:false">
            <div class="toolbar" style="height: 65px;">
                <div>
                    <label>
                        <%: Html.Language("RoomNumber")%>：</label>
                    <input id="txtRoomNumber" class="easyui-validatebox" style="width: 60px;" />
                    <select id="cbxIsSyncRoomNumber" class="easyui-combobox" style="width: 60px;" data-options="panelHeight: 'auto',editable: false,onSelect:groupTreeOnSelect">
                        <option value='2'><%: Html.Language("All")%></option>
                        <option value='1' selected="selected"><%: Html.Language("Sync")%></option>
                        <option value='0'><%: Html.Language("NoSync")%></option>
                    </select>
                    <label>
                        MAC：</label>
                    <input id="txtMac" class="easyui-validatebox" style="width: 120px;" />
                    <label>
                        <%: Html.Language("RoomType")%></label>
                    <input id="txtRoomType" class="easyui-validatebox" style="width: 60px;" />
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-search" onclick="groupTreeOnSelect();">
                        <%: Html.Language("Query")%></a>
                    <%--<a href="javascript:void(0)" class="toolbar-button tb-icon-search" onclick="hostSearcher.open()"><%: Html.Language("Search")%></a>--%>
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-add" onclick="add()">
                        <%: Html.Language("New") %></a> 
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-edit" onclick="edit()">
                        <%: Html.Language("Edit") %></a> 
                    
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-remove" onclick="delHost()">
                            <%: Html.Language("Delete") %></a> 

                    <a href="javascript:void(0)" class="toolbar-button tb-icon-import" onclick="$('#formImportHosts').form('reset');$('#importHosts').window('open')">
                                <%: Html.Language("Import")%></a> 

                    <a href="/Host/ExportExcel/" class="toolbar-button tb-icon-export" target="_blank"> <%: Html.Language("Export")%></a> 

                    <a href="javascript:void(0)" class="toolbar-button tb-icon-network" onclick="toolSync()">工具同步</a>

                </div>
                <div>
                    <%--<a href="javascript:void(0)" class="toolbar-button tb-icon-apply" onclick="publishInfo()"><%: Html.Language("PublishInfo")%></a>--%>
                    <% if ((bool)ViewData["AUTHORITY_HostAuthority"])
                       { %>
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-password" onclick="hostAuthorization()">
                        <%: Html.Language("HostAuthorization")%></a>
                    <% } if ((bool)ViewData["EnableDataUpgrade"])
                       { %>
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-upgrade" onclick="updateHost()">
                        通用升级</a>
                    <% } if ((bool)ViewData["AUTHORITY_CHostUpgrade"])
                       { %>
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-upgrade" onclick="updateHostC()">
                        C系列升级</a>
                    <% } %>
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-apply" onclick="smartVoiceBinding()">
                        <%: Html.Language("SmartVoiceBinding")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-network"
                            onclick="dockingInfo()">
                            <%: Html.Language("DockingInformation")%></a>
                    <% if ((bool)ViewData["AUTHORITY_MACAuthority"])
                       { %>
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-search" onclick="macSearch()">
                        MAC查询</a>

                    <!--添加一个生成主机编号的功能-->
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-upgrade" onclick="generichostnumber()"> 生成主机编号</a>
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-network" onclick="getrcuinfocmd()"> 获取主机信息</a>
                    <% } %>
                </div>
            </div>
        </div>
        <div title="" style="border-right: 1px solid #95B8E7;" data-options="region:'center',border:false">
            <table id="dg" class="easyui-datagrid" style="width: 100%;" data-options="
						border: false,
						singleSelect: true,
						pagination: true,
						pageSize: 150,
                        pageList: [100, 150, 200, 500],
						rownumbers: true,
						sortName: 'RegisterDate',
						sortOrder: 'desc',
						fit: true,
						fitColumns: true,
						striped: true,
						idField: 'ID',
						frozenColumns: [[
							{ field: 'ID', checkbox: true }
						]],
						method: 'POST',
						onDblClickRow: function(index, row) { edit(row); }
					">
                <thead>
                    <tr>
                        <th data-options="field:'HostNumber',sortable:true,align:'center'">
                            <%: Html.Language("ID") %>
                        </th>
                        <th data-options="field:'Code',sortable:true,align:'center'">
                            <%: Html.Language("Code")%>
                        </th>
                        <th data-options="field:'RoomNumber',sortable:true,align:'center'">
                            <%: Html.Language("RoomNumber") %>
                        </th>
                        <th data-options="field:'MAC',sortable:true">
                            <%: Html.Language("MAC")%>
                        </th>
                        <th data-options="field:'GroupName',sortable:true">
                            <%: Html.Language("Group") %>
                        </th>
                        <th data-options="field:'RoomType',sortable:true">
                            <%: Html.Language("RoomType") %>
                        </th>
                        <th data-options="field:'IPType',sortable:true,align:'center'">
                            <%: Html.Language("IPType")%>
                        </th>
                        <th data-options="field:'IP',sortable:true">
                            <%: Html.Language("IP")%>
                        </th>
                        <th data-options="field:'Port',sortable:true">
                            <%: Html.Language("Port")%>
                        </th>

                        <th data-options="field:'Version',sortable:true">
                            固件APP版本
                        </th>

                        <th data-options="field:'LanIP',sortable:true">
                            <%: Html.Language("LanIP")%>
                        </th>
                        <th data-options="field:'LanPort',sortable:true">
                            <%: Html.Language("LanPort")%>
                        </th>
                        <th data-options="field:'SubnetMask',sortable:true">
                            <%: Html.Language("SubnetMask")%>
                        </th>
                        <th data-options="field:'Gateway',sortable:true">
                            <%: Html.Language("Gateway")%>
                        </th>
                        <th data-options="field:'DNS',sortable:true">
                            DNS
                        </th>
                        <th data-options="field:'Season',sortable:true">
                            <%: Html.Language("Season")%>
                        </th>
                        <th data-options="field:'ServerIP',sortable:true">
                            <%: Html.Language("ServerIP")%>
                        </th>
                        <th data-options="field:'ServerPort',sortable:true">
                            <%: Html.Language("ServerPort")%>
                        </th>
<%--                        <th data-options="field:'Version',sortable:true">
                            固件APP版本
                        </th>--%>
                        <th data-options="field:'ConfigVersion',sortable:true">
                            <%: Html.Language("ConfigVersion") %>
                        </th>
                        <th data-options="field:'Model',sortable:true">
                            <%: Html.Language("Model")%>
                        </th>
                        <th data-options="field:'Launcher',sortable:true">
                            Launcher
                        </th>
                        <th data-options="field:'IsSyncRoomNumber',align:'center',formatter:function(val,rec){return val ? lang.Yes : lang.No;}">
                            <%: Html.Language("IsSyncRoomNumber")%>
                        </th>
                        <th data-options="field:'IsAutoUpdate',align:'center',formatter:function(val,rec){return val ? lang.Yes : lang.No;}">
                            <%: Html.Language("IsAutoUpdate")%>
                        </th>
                        <th data-options="field:'RegisterDate',sortable:true">
                            <%: Html.Language("RegistrationDate")%>
                        </th>
                        <th data-options="field:'ExpireTime',sortable:true">
                            <%: Html.Language("ExpireTime")%>
                        </th>
                        <th data-options="field:'SetExpireTime',sortable:true">
                            <%: Html.Language("SetExpireTime")%>
                        </th>
                        <th data-options="field:'Remark'">
                            <%: Html.Language("Remark") %>
                        </th>
                        <th data-options="field:'XiaoDuCUID'">
                            小度CUID
                        </th>
                        <th data-options="field:'TianMaoCUID'">
                            天猫精灵CUID
                        </th>
                        <th data-options="field:'TCLCUID'">
                            TCL CUID
                        </th>
                        <th data-options="field:'HuaWeiCUID'">
                            华为CUID
                        </th>
                        <th data-options="field:'RokidWebhookUrl'">
                            若琪Webhook Url
                        </th>
                    </tr>
                </thead>
            </table>
        </div>
        <div style="width: 270px; border-left: 1px solid #95B8E7;" data-options="region: 'east',split: true,border: false">
            <div class="easyui-layout" data-options="fit:true">
                <div data-options="region:'north',border:false" style="overflow: hidden;">
                    <div class="toolbar">
                        <a href="javascript:void(0)" class="toolbar-button tb-icon-add" onclick="group.add()">
                            <%: Html.Language("New") %></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-edit"
                                onclick="group.edit()">
                                <%: Html.Language("Edit") %></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-remove"
                                    onclick="group.del()">
                                    <%: Html.Language("Delete") %></a>
                    </div>
                </div>
                <div data-options="region:'center',border:false">
                    <table id="groupTree" class="easyui-treegrid" data-options="
							url: '/Group/LoadGroupTree/',
							method: 'post',
							idField: 'ID',
							treeField: 'Name',
							fit: true,
							fitColumns: true,
							animate: true,
							border: false,
							bodyCls: 'easyui-treegrid-no-icon',
							loadMsg: '<%: Html.Language("Loading") %>',
                            onLoadSuccess: function (row, data) {if (data[0] != null) {$('#groupTree').treegrid('select', data[0].ID);}},
							onSelect: groupTreeOnSelect
						">
                        <thead>
                            <tr>
                                <th data-options="field:'Name',width:160">
                                    <%: Html.Language("Name") %>
                                </th>
                                <th data-options="field:'Sort',align:'center',width:40">
                                    <%: Html.Language("Sort") %>
                                </th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>    
    <div id="importHosts" class="easyui-window" title='主机导入'
        style="width: 400px; height: 180px; padding: 5px;" data-options="
			closed: true,
			modal: true,
			collapsible: false,
			minimizable: false,
			maximizable: false
		">
        <div class="easyui-layout" fit="true">
            <div style="padding-top: 25px;" data-options="region:'center'">
                <form id="formImportHosts" method="post" enctype="multipart/form-data">
                <table style="width: 100%;">
                    <tr>
                        <th>
                            <%: Html.Language("SelectingFiles")%>
                        </th>
                        <td>
                            <input class="easyui-filebox" id="txtImportHostExcelPath" name="file" style="width: 90%;" data-options="buttonText:lang.Browse" />
                        </td>
                    </tr>
                </table>
                </form>
            </div>
            <div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
                <a class="easyui-linkbutton" data-options="iconCls:'icon-save'" href="javascript:void(0)"
                    onclick="importHosts();">
                    <%: Html.Language("Import")%></a> <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'"
                        href="javascript:void(0)" onclick="$('#importHosts').window('close');">
                        <%: Html.Language("Cancel")%></a>
            </div>
        </div>
    </div>
    <div id="divHostAuthorization" class="easyui-window" title='<%: Html.Language("HostAuthorization")%>'
        style="width: 880px; height: 500px;" data-options="
			closed: true,
			modal: true,
			collapsible: false,
			minimizable: false,
			maximizable: false
		">
        <div class="easyui-layout" fit="true">
            <div data-options="region:'north',border:false">
                <div class="toolbar">
                    <label>
                        <%: Html.Language("RoomType")%></label>
                    <input id="cbxRoomType1" class="easyui-combobox" style="width: 180px;" data-options="
						    url:'/RoomType/LoadRoomType/',
						    editable:false,
						    panelHeight:'200px',
						    valueField:'ID',
						    textField:'Name',
						    onSelect: cbxRoomTypeOnSelect1
					" />
                    <label>
                        <%: Html.Language("ExpireTime")%>：</label>
                    <input id="txtExpireTime" name="ExpireTime" class="easyui-datetimebox" data-options="required:true,editable:false"
                        value="<%: DateTime.Now.AddYears(1).ToString("yyyy-MM-dd HH:mm:ss") %>" />
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-register',plain:true"
                        onclick="secureClick();">
                        <%: Html.Language("Secure")%></a> <a href="javascript:void(0)" class="easyui-linkbutton"
                            data-options="iconCls:'icon-upload',plain:true" onclick="saveHostAuthorization();">
                            <%: Html.Language("HostAuthorization")%></a> <a href="javascript:void(0)" class="easyui-linkbutton"
                                data-options="iconCls:'icon-update',plain:true" onclick="$('#tbHostAuthorization').datagrid('reload');">
                                <%: Html.Language("Refresh")%></a>
                </div>
            </div>
            <div style="width: 842px; border-left: 1px solid #95B8E7;" data-options="region:'center',border:false,split:true">
                <table id="tbHostAuthorization" class="easyui-datagrid" style="width: 100%;" data-options="
						border: false,
						singleSelect: false,
						pagination: false,
						rownumbers: true,
						sortName: 'RoomNumber',
						sortOrder: 'asc',
						fit: true,
						fitColumns: true,
						striped: true,
						idField: 'ID',
						frozenColumns: [[
							{ field: 'ID', checkbox: true }
						]],
						method: 'POST'
					">
                    <thead>
                        <tr>
                            <th data-options="field:'RoomNumber',sortable:true,align:'center'">
                                <%: Html.Language("RoomNumber") %>
                            </th>
                            <th data-options="field:'Status',sortable:true,align:'center',formatter:function(val,rec){return val ? lang.Online : lang.Offline;}">
                                <%: Html.Language("Status")%>
                            </th>
                            <th data-options="field:'MAC',sortable:true">
                                <%: Html.Language("MAC")%>
                            </th>
                            <th data-options="field:'ExpireTime',sortable:true">
                                <%: Html.Language("ExpireTime")%>
                            </th>
                            <th data-options="field:'SetExpireTime',sortable:true">
                                <%: Html.Language("SetExpireTime")%>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
    <div id="updateHostC" class="easyui-window" title='<%: Html.Language("HostUpgrade")%>'
        style="width: 1100px; height: 500px;" data-options="
			closed: true,
			modal: true,
			collapsible: false,
			minimizable: false,
			maximizable: false
		">
        <div class="easyui-layout" fit="true">
            <div data-options="region:'north',border:false">
                <div class="toolbar" style="height: 66px;">
                    <label>
                        <%: Html.Language("RoomType")%></label>
                    <input id="cbxRoomType" class="easyui-combobox" style="width: 180px;" data-options="
						    url:'/RoomType/LoadRoomType/',
						    editable:false,
						    panelHeight:'200px',
						    valueField:'ID',
						    textField:'Name',
						    onSelect: cbxRoomTypeOnSelect
					" />
                    <a id="btnGetFiles" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-excel',plain:true"
                        onclick="getUpdatedFile()">获取文件</a> <a href="javascript:void(0)" class="easyui-linkbutton"
                            data-options="iconCls:'icon-register',plain:true" onclick="publishInfo();">房型房号下发</a>
                    <br />
                    <label>
                        文件</label>
                    <input id="cbxFiles" class="easyui-combobox" style="width: 500px;" data-options="editable:false,panelHeight:'auto',valueField:'id',textField:'text'" />
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-update',plain:true"
                        onclick="updateC()">升级文件</a> 
                    <a href="javascript:void(0)" class="easyui-linkbutton"
                            data-options="iconCls:'icon-upload',plain:true" onclick="stopUpgradeC()">停止刷新</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-update',plain:true"
                        onclick="refreshUpdateStatusC()">强制刷新</a>
                </div>
            </div>
            <!--阿宝添加的RCU升级功能在这里-->
            <div style="width: 942px; border-left: 1px solid #95B8E7;" data-options="region:'center',border:false,split:true">
                 <input type="hidden" value="<%=Session["CurrentHotelID"] %>" id="CurrentHotelID"/>
                <table id="tbHosts" class="easyui-datagrid" style="width: 100%;" data-options="
						border: false,
						singleSelect: false,
						pagination: false,
						rownumbers: true,
						sortName: 'RoomNumber',
						sortOrder: 'asc',
						fit: true,
						fitColumns: true,
						striped: true,
						idField: 'ID',
						frozenColumns: [[
							{ field: 'ID', checkbox: true }
						]],
						method: 'POST',
                        rowStyler: function(index,row)
                        {
                             console.log(row.Status);
                             if(!row.Status)
                             {
                                return 'background-color:#FF0000;color:#fff;font-weight:bold;';
                             }
                        }
					">
                    <thead>
                        <tr>
                            <th data-options="field:'RoomNumber',sortable:true,align:'center'">
                                <%: Html.Language("RoomNumber") %>
                            </th>
                            <th data-options="field:'Status',sortable:true,align:'center',formatter:function(val,rec){return val ? lang.Online : lang.Offline;}">
                                <%: Html.Language("Status")%>
                            </th>
                            <th data-options="field:'MAC',sortable:true">
                                <%: Html.Language("MAC")%>
                            </th>
                            <th data-options="field:'Model',sortable:true">
                                <%: Html.Language("Model")%>
                            </th>
                            <th data-options="field:'Launcher',sortable:true">
                                Launcher
                            </th>
                            <th data-options="field:'Version',sortable:true">
                                固件APP版本
                            </th>
                            <th data-options="field:'ConfigVersion',sortable:true">
                                <%: Html.Language("ConfigVersion") %>
                            </th>
                            <th data-options="field:'ProgressBar',sortable:true">
                                下载进度 
                            </th>
                            <th data-options="field:'UpgradeStatus',sortable:true,formatter:function(val,rec){ switch(val){case 0:return '升级就绪';case 1:return '升级成功';case 2:return '升级失败';default:return val;} }">
                                <%: Html.Language("UpgradeStatus")%>
                            </th>
                            <th data-options="field:'UpgradeTime',sortable:true">
                                <%: Html.Language("UpgradeTime")%>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
    <div id="updateHost" class="easyui-window" title='<%: Html.Language("HostUpgrade")%>'
        style="width: 950px; height: 500px;" data-options="
			closed: true,
			modal: true,
			collapsible: false,
			minimizable: false,
			maximizable: false
		">
        <div class="easyui-layout" fit="true">
            <div style="border-right: 1px solid #95B8E7;" data-options="region:'center',border:false">
                <table id="dgUpdateHost" class="easyui-datagrid" style="width: 100%; height: auto;"
                    data-options="
							toolbar: '#updateHostToolbar',
							border: false,
							singleSelect: true,
							pagination: true,
							pageSize: 50,
							rownumbers: true,
							sortName: 'UploadTime',
							sortOrder: 'desc',
							fit: true,
							fitColumns: true,
							idField: 'ID',
							frozenColumns: [[
								{ field: 'ID', checkbox: true }
							]],
							url: '/HostUpdate/LoadAllByPage/',
							onSelect: dgUpdateHostOnSelect,
							method: 'post'
						">
                    <thead>
                        <tr>
                            <th data-options="field:'FileName',width:120,sortable:true,formatter:$.tools.formatCellTooltip">
                                <%: Html.Language("UpgradePackageName")%>
                            </th>
                            <th data-options="field:'FileType',sortable:true,formatter:function(value){ switch(value) { case 0: return lang.FirmwareFile; case 1: return lang.ConfigurationFile; case 2: return lang.RCUFile; default: return ''; } }">
                                <%: Html.Language("DocumentType")%>
                            </th>
                            <th data-options="field:'Size',sortable:true,formatter:function(value){ return (value / 1024.0 / 1024.0).toFixed(2); }">
                                <%: Html.Language("Size")%>(MB)
                            </th>
                            <th data-options="field:'UploadTime',sortable:true,formatter:$.tools.formatDateTime">
                                <%: Html.Language("UploadDate")%>
                            </th>
                            <th data-options="field:'Account',sortable:true">
                                <%: Html.Language("UploadPeople")%>
                            </th>
                            <th data-options="field:'Href',sortable:true,formatter:downloadFile">
                                <%: Html.Language("Operation")%>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
            <div style="width: 250px; border-left: 1px solid #95B8E7;" data-options="region:'east',border:false,split:true">
                <ul id="treeRoomType" class="easyui-tree" data-options="checkbox:true,animate:true,lines:true,url:'/HostUpdate/LoadRoomType/',onCheck:treeRoomTypeonCheck">
                </ul>
                <ul id="treeRoomNumber" class="easyui-tree" data-options="checkbox:true,animate:true,lines:true,url:'/HostUpdate/LoadGroupTreeWithRoom/'">
                </ul>
            </div>
        </div>
        <div id="updateHostToolbar" style="vertical-align: middle;">
            <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-upload',plain:true"
                onclick="$('#uploadForm').form('reset');$('#uploadFile').window('open')">
                <%: Html.Language("Upload")%></a> <a href="javascript:void(0)" class="easyui-linkbutton"
                    data-options="iconCls:'icon-remove',plain:true" onclick="delHostUpdate()">
                    <%: Html.Language("Delete")%></a> <span style="vertical-align: middle;">
                        <input type="radio" name="rd" value="1" checked="checked" />TFTP</span>
            <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-update',plain:true"
                onclick="update()">
                <%: Html.Language("ReleaseUpgrade")%></a>
        </div>
    </div>
    <div id="uploadFile" class="easyui-window" title='<%: Html.Language("UploadUpdatePackage")%>'
        style="width: 400px; height: 180px; padding: 5px;" data-options="
			closed: true,
			modal: true,
			collapsible: false,
			minimizable: false,
			maximizable: false
		">
        <div class="easyui-layout" fit="true">
            <div style="padding-top: 25px;" data-options="region:'center'">
                <form id="uploadForm" method="post" enctype="multipart/form-data">
                <table style="width: 100%;">
                    <tr>
                        <th>
                            <%: Html.Language("DocumentType")%>
                        </th>
                        <td>
                            <select id="cbxFileType" name="FileType" class="easyui-combobox" data-options="requried:true,editable:false,panelHeight:'auto'">
                                <option value="0">
                                    <%: Html.Language("FirmwareFile")%>(*.bin)</option>
                                <option value="1">
                                    <%: Html.Language("ConfigurationFile")%>(*.xml|*.dat)</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            <%: Html.Language("SelectingFiles")%>
                        </th>
                        <td>
                            <input class="easyui-filebox" id="uf" name="file" style="width: 90%;" data-options="buttonText:lang.Browse" />
                        </td>
                    </tr>
                </table>
                </form>
            </div>
            <div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
                <a class="easyui-linkbutton" data-options="iconCls:'icon-save'" href="javascript:void(0)"
                    onclick="uploadFile();">
                    <%: Html.Language("Upload")%></a> <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'"
                        href="javascript:void(0)" onclick="$('#uploadFile').window('close');">
                        <%: Html.Language("Cancel")%></a>
            </div>
        </div>
    </div>
    <div id="dialog" class="easyui-window" style="padding: 5px;" data-options="
		closed: true,
		modal: true,
		collapsible: false,
		minimizable: false,
		maximizable: false
	">
        <div class="easyui-panel dlg-content" style="margin-bottom: 5px;">
        </div>
        <div class="dlg-footer" style="text-align: right; padding: 5px 5px 0 0;">
            <a class="easyui-linkbutton dlg-btn-save" data-options="iconCls:'icon-save'" href="javascript:void(0)">
                <%: Html.Language("Save") %></a> <a class="easyui-linkbutton dlg-btn-cancel" data-options="iconCls:'icon-cancel'"
                    href="javascript:void(0)" onclick="$('#dialog').window('close');">
                    <%: Html.Language("Cancel") %></a>
        </div>
    </div>
    <div id="dialog2" class="easyui-window" style="padding: 5px;" data-options="
		closed: true,
		modal: true,
		collapsible: false,
		minimizable: false,
		maximizable: false
	">
        <div class="easyui-panel dlg-content" style="margin-bottom: 5px;">
        </div>
        <div class="dlg-footer" style="text-align: right; padding: 5px 5px 0 0;">
            <a class="easyui-linkbutton dlg-btn-save" data-options="iconCls:'icon-save'" href="javascript:void(0)">
                <%: Html.Language("Issue")%></a> <a class="easyui-linkbutton dlg-btn-cancel" data-options="iconCls:'icon-cancel'"
                    href="javascript:void(0)" onclick="FoundDeviceList();">
                    <%: Html.Language("Cancel") %></a>
        </div>
    </div>
    <div id="macSearch" class="easyui-window" title='MAC查询' style="width: 680px; height: 500px;"
        data-options="
			closed: true,
			modal: true,
			collapsible: false,
			minimizable: false,
			maximizable: false
		">
        <div class="easyui-layout" fit="true">
            <div data-options="region:'north',border:false">
                <div class="toolbar" style="height: 32px;">
                    <label>
                        MAC：</label>
                    <input id="txtMACSearch" class="easyui-validatebox" style="width: 120px;" />
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-search" onclick="loadMACSearch();">
                        <%: Html.Language("Query")%></a>
                </div>
            </div>
            <div style="width: 842px; border-left: 1px solid #95B8E7;" data-options="region:'center',border:false,split:true">
                <table id="tbMACSearch" class="easyui-datagrid" style="width: 100%;" data-options="
						border: false,
						singleSelect: false,
						pagination: false,
						rownumbers: true,
						sortName: 'MAC',
						sortOrder: 'asc',
						fit: true,
						fitColumns: true,
						striped: true,
						idField: 'ID',
						method: 'POST'
					">
                    <thead>
                        <tr>
                            <th data-options="field:'ID',sortable:true,align:'center'">
                                ID
                            </th>
                            <th data-options="field:'RoomNumber',sortable:true,align:'center'">
                                <%: Html.Language("RoomNumber") %>
                            </th>
                            <th data-options="field:'MAC',sortable:true">
                                <%: Html.Language("MAC")%>
                            </th>
                            <th data-options="field:'Name',sortable:true">
                                <%: Html.Language("Hotel1")%>
                            </th>
                            <th data-options="field:'Code',sortable:true,align:'center'">
                                <%: Html.Language("Code")%>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>

 <script src="/Scripts/wssupgrade.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <style type="text/css">
        #uploadForm table th
        {
            font-weight: normal;
            cursor: default;
        }
    </style>
    <script src="/Scripts/mqtt.min.js" type="text/javascript"></script>
    <script src="/Scripts/group.js" type="text/javascript"></script>
    <% switch ((int)Session["isCN"])
       {
           case 1: %>
    <script type="text/javascript" src="/Scripts/en-US.js"></script>
    <% break;
           case 2: %>
    <script type="text/javascript" src="/Scripts/zh-TW.js"></script>
    <% break;
           default: %>
    <script type="text/javascript" src="/Scripts/zh-CN.js"></script>
    <% break;
       } %>
    <script src="/Scripts/host-index.js" type="text/javascript"></script>
</asp:Content>
