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

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%: Html.Language("RoomStatus")%>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<div title='<%: Html.Language("RoomStatus")%>' class="easyui-panel" data-options="fit:true,border:false">
		<table id="dg" class="easyui-datagrid" style="width:100%; height:auto;"
			data-options="
					toolbar: '#tb',
					border: false,
					singleSelect: true,
					pagination: true,
					pageSize: 50,
					rownumbers: true,
					striped: true,
					sortName: 'RoomNumber',
					sortOrder: 'asc',
					fit: true,
					fitColumns: true,
					idField: 'ID',
					frozenColumns: [[
						{ field: 'ID', checkbox: true }
					]],
					url: '/RoomStatus/LoadRoomStatus/',
					method: 'post',
					loadFilter: dgLoadFilter,
					autoRowHeight: false,
					rowStyler: function(){ return { class: 'dg-row-style' }; },
					onDblClickRow: function(index, row){ detail(row); },
					onRowContextMenu: dgOnRowContextMenu,
					groupField: 'RoomStatus',
					view: groupview,
					groupFormatter: function(value, rows){
						return value + '(' + rows.length + ')';
					}
				">
			<thead>
				<tr>
					<th data-options="field:'Status',align:'center',formatter:statusFormatter" rowspan="2">
						<%: Html.Language("Status")%>
					</th>
					<th data-options="field:'RoomNumber',align:'center',sortable:true" rowspan="2">
						<%: Html.Language("RoomNumber")%>
					</th>
					<th data-options="field:'RoomStatus',align:'center',sortable:true" rowspan="2">
						<%: Html.Language("RoomStatus")%>
					</th>
					<th data-options="field:'RoomCard',align:'center',sortable:true" rowspan="2">
						<%: Html.Language("Identity")%>
					</th>
					<th data-options="field:'CardUserName',align:'center',sortable:true" rowspan="2">
						<%: Html.Language("FullName")%>
					</th>
					<th data-options="align:'center'" colspan="4">
						<%: Html.Language("ServiceRequest")%>
					</th>
					<th data-options="align:'center'" colspan="3">
						<%: Html.Language("AlarmStatus")%>
					</th>
					<th data-options="align:'center'" colspan="3">
						<%: Html.Language("AirConditioningStatus")%>
					</th>
				</tr>

				<tr>
					<th data-options="field:'RequestService',align:'center',sortable:true,formatter:requestServiceFormatter">
						<%: Html.Language("Service")%>
					</th>
					<th data-options="field:'RequestClear',align:'center',sortable:true,formatter:requestClearFormatter">
						<%: Html.Language("Clean")%>
					</th>
					<th data-options="field:'RequestDNDST',align:'center',sortable:true,formatter:requestDNDSTFormatter">
						<%: Html.Language("NoDisturb")%>
					</th>
					<th data-options="field:'RequestCheckOut',align:'center',sortable:true,formatter:requestCheckOutFormatter">
						<%: Html.Language("CheckOut")%>
					</th>

					<th data-options="field:'SOS',align:'center',sortable:true,formatter:SOSFormatter">
						SOS
					</th>
					<th data-options="field:'DoorLockStatus',align:'center',sortable:true,formatter:doorLockStatusFormatter">
						<%: Html.Language("GateLock")%>
					</th>
					<th data-options="field:'SafeStatus',align:'center',sortable:true,formatter:safeStatusFormatter">
						<%: Html.Language("Safe")%>
					</th>

					<th data-options="field:'CurrentTemp',align:'center',sortable:true,formatter:function(value){ return value + '℃' }">
						<%: Html.Language("Temperature")%>
					</th>
					<th data-options="field:'SettingTemp',align:'center',sortable:true,formatter:function(value){ return value + '℃' }">
						<%: Html.Language("SetTemperature")%>
					</th>
					<th data-options="field:'Speed',align:'center',sortable:true,formatter:speedFormatter">
						<%: Html.Language("TheWindWpeed")%>
					</th>
				</tr>
			</thead>
		</table>
	</div>
	<div id="tb" style="padding-left:10px;">
		<%: Html.Language("Floor")%>：
        <select id="selGroup" name="GroupID" class="easyui-combotree" style="width:100px;" 
            data-options="
                url:'/Group/LoadCurrentUserGroupTree/',
                lines:true,
                editable: false,
                bodyCls:'easyui-tree-no-icon'
            ">
        </select>&nbsp;

		<%: Html.Language("Status")%>：
		<select id="selHostStatus" name="Status" class="easyui-combobox" style="width:100px;" data-options="panelHeight: 'auto',editable: false">
			<option value=""> <%: Html.Language("All")%></option>
			<option value="1"><%: Html.Language("Online")%></option>
			<option value="0"><%: Html.Language("Offline")%></option>
		</select>&nbsp;

		<%: Html.Language("RoomNumber")%>：
		<input id="txtRoomNumber" class="easyui-textbox" style="width:100px;" />

        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="query()"><%: Html.Language("Query")%></a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-room-status-detail',plain:true" onclick="detail()"><%: Html.Language("Detailed")%></a>
		<label style="vertical-align:middle;"><input id="chkTimingRefresh" type="checkbox" style="vertical-align:middle;" /><%: Html.Language("TimingUpdated")%></label>
    </div>

	<div id="dialog" class="easyui-window"   title="" style="width:650px; height:500px; padding:5px;" 
		closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false"
		data-options="
			tools:[
				{ iconCls: 'icon-reload', handler: function() { $('#dialog').window('refresh'); } }
			]
		">
	</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server"> 
	<link type="text/css" rel="stylesheet" href="/Styles/room-status-index.css" />
	<script type="text/javascript" src="/easyui-1.4.2/datagrid-groupview.js"></script>
	<script type="text/javascript" src="/Scripts/room-status-index.js"></script>
</asp:Content>

