<%@ 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("HotelMgmt")%>
</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" style="overflow: hidden; height: 30px;">
            <div class="toolbar">
                <label>
                    <%: Html.Language("QueryContent")%>：</label>
                <input id="txtQueryContent" class="easyui-validatebox" style="width: 120px;" />
                <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-refresh" onclick="$('#dg').datagrid('load',{});">
                    <%: Html.Language("Refresh") %></a>--%>
                <% if ((bool)ViewData["EditHotel"])
                   { %>
                <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="del()">
                            <%: Html.Language("Delete") %></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-air"
                                onclick="setLogo()">
                                <%: Html.Language("SetLogo") %></a>

                <% } %>
            </div>
        </div>
        <div data-options="region:'center',border:false">
            <table id="dg" class="easyui-datagrid" style="width: 100%; height: auto;" data-options="
						toolbar: '#tb',
						singleSelect: true,
						border: false,
						pagination: true,
						pageSize: 100,
                        pageList: [50, 100, 200, 500],
						rownumbers: true,
						striped: true,
						sortName: 'ID',
						sortOrder: 'desc',
						fit: true,
						fitColumns: true,
						idField: 'ID',
						frozenColumns: [[ { field: 'ID', checkbox: true } ]],
						url: '/SysHotel/LoadAllByPage/',
						method: 'post'
						<% if ((bool)ViewData["EditHotel"]){ %>,onDblClickRow: function(index, row) { edit(row); }<% } %>
					">
                <thead>
                    <tr>
                        <th data-options="field:'Code',sortable:true">
                            <%: Html.Language("Code")%>
                        </th>
                        <th data-options="field:'Name',sortable:true">
                            <%: Html.Language("Name")%>
                        </th>
                        <th data-options="field:'EName',sortable:true">
                            <%: Html.Language("EName")%>
                        </th>
                        <th data-options="field:'TWName',sortable:true">
                            <%: Html.Language("TWName")%>
                        </th>
                        <th data-options="field:'SysHotelGroupName',sortable:true,resizable:false">
                            <%: Html.Language("Group")%>
                        </th>
                        <th data-options="field:'IsApprove',align:'center',formatter:function(val,rec){return val ? lang.Yes : lang.No;}">
                            <%: Html.Language("Approve")%>
                        </th>
                        <th data-options="field:'ValidateDate',sortable:true,resizable:false,formatter:$.tools.formatDateExpire">
                            <%: Html.Language("EndDate")%>
                        </th>
                        <th data-options="field:'Status',align:'center',formatter:function(val,rec){switch(val){case 1:return lang.BatchInstallation;case 2:return lang.ModelRoom;default:return lang.FormalOperation;}}">
                            <%: Html.Language("Status")%>
                        </th>
                        <th data-options="field:'Remark',resizable:false">
                            <%: Html.Language("Remark")%>
                        </th>
                        <th data-options="field:'Contact',sortable:true">
                            <%: Html.Language("Contact")%>
                        </th>
                        <th data-options="field:'Phone',sortable:true">
                            <%: Html.Language("Phone")%>
                        </th>
                        <th data-options="field:'Address',sortable:true">
                            <%: Html.Language("Address")%>
                        </th>
                        <%--<th data-options="field:'AssociatedAccount',sortable:true">
                            <%: Html.Language("AssociatedAccount")%>
                        </th>--%>
                        <th data-options="field:'Sort',align:'center',resizable:false">
                            <%: Html.Language("Sort")%>
                        </th>
                        <th data-options="field:'LogoPath',resizable:false">
                            <%: Html.Language("LogoImage")%>
                        </th>
                        <%--<th data-options="field:'Styles',resizable:false">
                            <%: Html.Language("Styles")%>
                        </th>
                       <th data-options="field:'IsAutoGetKey',align:'center',formatter:function(val,rec){return val ? lang.Yes : lang.No;}">
                            <%: Html.Language("AutoGetKey")%>
                        </th>
                        <th data-options="field:'WelcomeSpeech',resizable:false">
                            <%: Html.Language("WelcomeSpeech")%>
                        </th>
                        <th data-options="field:'GoodbyeSpeech',resizable:false">
                            <%: Html.Language("GoodbyeSpeech")%>
                        </th>
                        <th data-options="field:'TVControlUrl',resizable:false">
                            DUI TV Url
                        </th>
                        <th data-options="field:'TVControlToken',resizable:false">
                            DUI TV Token
                        </th>
                        <th data-options="field:'DeviceStatusPushURL',resizable:false">
                            <%: Html.Language("DSPA")%>
                        </th>
                        <th data-options="field:'DomainUrl',resizable:false">
                            <%: Html.Language("Domain")%>
                        </th>--%>
                        <th data-options="field:'CreatedBy',sortable:true,resizable:false">
                            <%: Html.Language("Founder")%>
                        </th>
                        <th data-options="field:'CreatedDate',sortable:true,resizable:false,formatter:$.tools.formatDate">
                            <%: Html.Language("CreatedDate")%>
                        </th>
                        <th data-options="field:'ModifiedBy',sortable:true,resizable:false">
                            <%: Html.Language("ModifiedPerson")%>
                        </th>
                        <th data-options="field:'ModifiedDate',sortable:true,resizable:false,formatter:$.tools.formatDate">
                            <%: Html.Language("ModifiedDate")%>
                        </th>
                    </tr>
                </thead>
            </table>
        </div>
        <div data-options="region:'east',border:false" style="width: 250px; border-left: 1px solid #95B8E7;">
            <% if ((bool)ViewData["EditHotel"])
               { %>
            <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>
            <% } %>
            <table id="groupTree" class="easyui-treegrid" data-options="
					url: '/SysHotel/LoadSysHotelGroupTree/',
					method: 'post',
					idField: 'ID',
					treeField: 'Name',
					fit: true,
					fitColumns: true,
					animate: true,
					border: false,
					loadMsg: 'load......',
					bodyCls: 'easyui-treegrid-no-icon',
                    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 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="uploadFile" class="easyui-window" title='<%: Html.Language("SetLogo")%>'
        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">
                <input type="hidden" id="txtID" name="id" value="0" />
                <table style="width: 100%;">
                    <tr>
                        <th colspan="2">
                            Size: 147*23
                        </th>
                    </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>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <% 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 type="text/javascript" src="/Scripts/sys_hotel_group.js"></script>
    <script type="text/javascript" src="/Scripts/sys-hotel-index.js"></script>
</asp:Content>
