<%@ 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("AlarmSetting")%>
</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">
				<a href="javascript:void(0)" class="toolbar-button tb-icon-refresh" data-bind="click: load"><%: Html.Language("Refresh")%></a>
				<a href="javascript:void(0)" class="toolbar-button tb-icon-save" data-bind="click: save"><%: Html.Language("Save")%></a>
			</div>
		</div>
		<div data-options="region:'center',border:false">
			<div data-bind="with: settings">
		
				<div id="col1">
					<div class="partbox">
						<div class="title"><%: Html.Language("DoorAlarmSettings")%></div>
						<div class="container">
							<div class="content">
								<ul data-bind="foreach: A">
									<!-- ko if: Code==='A01' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value, event: { change: $root.a01Change }" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A02' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="text" data-bind="enable: $root.a01Enable, value: Value" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A03' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value, event: { change: $root.a03Change }" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A04' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="text" data-bind="enable: $root.a03Enable, value: Value" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A05' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value, event: { change: $root.a05Change }" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A06' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="text" data-bind="enable: $root.a05Enable, value: Value" />
									</li>
									<!-- /ko -->
								</ul>
							</div>
						</div>
					</div>
			
					<div class="partbox">
						<div class="title"><%: Html.Language("TemperatureAnomaliesAlarmSettings")%></div>
						<div class="container">
							<div class="content">
								<ul data-bind="foreach: A">
									<!-- ko if: Code==='A09' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value, event: { change: $root.a09Change }" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A10' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="text" data-bind="value: Value, enable: $root.a09Enable" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A11' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="text" data-bind="value: Value, enable: $root.a09Enable" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A12' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="text" data-bind="value: Value, enable: $root.a09Enable" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A13' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="text" data-bind="value: Value, enable: $root.a09Enable" />
									</li>
									<!-- /ko -->
								</ul>
							</div>
						</div>
					</div>
			
					<div class="partbox">
						<div class="title"><%: Html.Language("SafeExceptionAlarmSettings")%></div>
						<div class="container">
							<div class="content">
								<ul data-bind="foreach: A">
									<!-- ko if: Code==='A07' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value" />
									</li>
									<!-- /ko -->
									<!-- ko if: Code=== 'A08' -->
									<li data-bind="with: $data">
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value" />
									</li>
									<!-- /ko -->
								</ul>
							</div>
						</div>
					</div>
		
				</div><!-- col1 end -->
		
				<div id="col2">
		
					<div class="partbox">
						<div class="title"><%: Html.Language("ServicePromptSettings")%></div>
						<div class="container">
							<div class="content">
								<ul data-bind="foreach: B">
									<li>
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value" />
										<!-- ko if: Code==='B01' -->
										<%: Html.Language("VoicePrompts")%>
										<input type="checkbox" data-bind="checked: Beep" />
										<!-- /ko -->
									</li>
								</ul>
							</div>
						</div>
					</div>
			
					<div class="partbox">
						<div class="title"><%: Html.Language("AbnormalPromptSettings")%></div>
						<div class="container">
							<div class="content">
								<ul data-bind="foreach: C">
									<li>
										<label data-bind="text: Name"></label>
										<input type="checkbox" data-bind="checked: Value" />
									</li>
								</ul>
								</div>
						</div>
					</div>
		
				</div><!-- col2 end -->
		
			</div>
		</div>
	</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <link type="text/css" rel="stylesheet" href="/Styles/partbox.css" />
    <style type="text/css">
        .partbox .container{
	        border:1px solid #00A2EA;
        }
		#container{
			width:640px;
			margin:10px;
		}
		#col1 {
			float:left;
			width:48%;
			padding: 5px;
		}
		#col2 {
			float:right;
			width:48%;
			padding: 5px;
		}
		.numberbox .textbox-text { 
			text-align:right;	
		}
		
		ul {
			padding: 0;
			margin: 0;
			list-style-type: none;
		}
		ul li {
			margin: 2px;
		}
		ul li label {
			display: inline-block;
			vertical-align: middle;
			width: 308px;
		}
		ul li input {
			display: inline-block;
			vertical-align: middle;
		}
		ul li input[type='text'] {
			width:100px;
			text-align: right;
		}
		
		#col1 {
			width: 450px;
			float: left;
			padding: 5px;
		}
		#col2 {
			width: 473px;
			float: left;
			padding: 5px;
		}
	</style>
	<script type="text/javascript" src="/Scripts/knockout-3.3.0.js"></script>
	<script type="text/javascript" src="/Scripts/knockout.mapping-latest.js"></script>
	<script type="text/javascript" src="/Scripts/alarm-setting-index.js"></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; } %>
</asp:Content>
