<%@
	taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %><%@
	page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %><%@
	page import="com.ubnt.data.X" %><%@
	page import="com.ubnt.data.Admin"
%><%


X context = (X) request.getAttribute("context");
Admin admin = (Admin) context.get("admin");
String role = context.getString("site_role");
boolean showOperatorTab = "admin".equals(role);	// Privilege.ROLE_ADMIN

/*
if (request.getParameter("lang") != null) {
  session.setAttribute("javax.servlet.jsp.jstl.fmt.locale.session", request.getParameter("lang"));
}
*/
//session.setAttribute("javax.servlet.jsp.jstl.fmt.locale.session", "zh_TW");
%><fmt:bundle basename="messages">
<!doctype html>
<!--[if lt IE 7]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7]>    <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8]>    <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9]>    <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
	<title><%=request.getServerName()%> - Hotspot Manager - <fmt:message key="product.shortname" /></title>
	<jsp:include page="head_include.jsp">
		<jsp:param name="page" value="hotspot" />
	</jsp:include>
</head>

<body class="unifi"
		adminid="<%=admin.getString("_id")%>"
		siteid="<%=context.getString("site_id")%>"
		sitename="<%=context.getString("site_name")%>"
		role="<%=role%>"
		>
	<div id="model-guests" style="display:none"></div>
	<div id="model-payments" style="display:none"></div>
	<div id="model-vouchers" style="display:none"></div>
	<div id="model-operators" style="display:none"></div>
	<div id="model-timefilters" style="display:none"></div>
	<div id="model-maintabpagesizer" style="display:none"></div>

	<jsp:include page="includes/dialogs/conn-dropped.jsp" />

    <!-- Start: Page Content -->
    <div id="PageContent" class="page-content">
        <!-- Start: Header -->
        <div id="PageHeader" class="page-header">
            <div class="header-logo">UniFi Logo</div>
		</div>
		<!-- End: Header -->
		<jsp:include page="includes/controls/refresh-control.jsp" />
		<jsp:include page="includes/controls/welcome.jsp" />
		
		<!-- Start: Main Panel -->
        <div id="MainPanel" class="main-panel">
            <!-- Start: Primary Tab Navigation -->
			<ul id="Navigation" class="navigation-tabs ui-alternate" style="display:block">
				<li><a href="#Guests" id="GuestsTab"><fmt:message key="HS_Guests" /></a></li>
				<li><a href="#Payments" id="PaymentsTab"><fmt:message key="HS_Payments" /></a></li>
				<li><a href="#Vouchers" id="VouchersTab"><fmt:message key="HS_Vouchers" /></a></li>
				<% if (showOperatorTab) { %>
				<li><a href="#Operators" id="OperatorsTab"><fmt:message key="HS_Accounts" /></a></li>
				<% } %>
			</ul>
			<!-- End: Primary Tab Navigation -->

            <!-- Start: Content -->
			<div id="Guests" class="tab-wrapper-scrollable">
				<div class="tab-content">
					<div class="section-title ui-dark"><fmt:message key="HS_GuestsTabTitle" />
						<span class="actions">
							<label>Page Size</label>
							<select class="table-pagesizer"></select>
						</span>
					</div>
					<div class="datatable-container">
						<div class="controlBar">
							<form>
								<fieldset>
									<ol>
										<li class="control by-time" style="float:right">
											<fmt:message key="HS_FilterWithin" />
											<select class="time-filter"></select>
										</li>
										<li class="control first">
											<input id="GuestTableSearch" class="text search" type="text" />
										</li>
									</ol>
								</fieldset>
							</form>
						</div>
						<div id="GuestTableContainer-none" class="empty-message-container content ui-corner-all">
							<p><fmt:message key="HS_NoActiveGuest" /></p>
						</div>
						<div id="GuestTableContainer"></div>
					</div>
				</div>
			</div>
			
		
			<div id="Vouchers" class="tab-wrapper-scrollable">
				<div class="tab-content">
					<div class="section-title ui-dark"><fmt:message key="HS_VouchersTabTitle" />
						<span class="actions">
							<label>Page Size</label>
							<select class="table-pagesizer"></select>
						</span>
					</div>
					<div class="datatable-container">
						<div class="controlBar">
							<form>
								<fieldset>
									<ol>
										<li class="control right">
											<input type="button" value="<fmt:message key="HS_PrintAllUnused" />" name="printall" class="button" style="float:right" />
										</li>
										<li class="control first">
											<input id="VoucherTableSearch" class="text search" type="text" />
										</li>
									</ol>
								</fieldset>
							</form>
						</div>
						<div id="VoucherTableContainer-none" class="empty-message-container content ui-corner-all">
							<p><fmt:message key="HS_NoActiveVoucher" /></p>
						</div>
						<div id="VoucherTableContainer"></div>
					</div>
					<div class="controlBar bottom  ui-corner-all">
						<form class="create">
							<fieldset>
								<ol>
									<li class="right">
										<input type="button" value="<fmt:message key="HS_CreateVoucher" />" name="create" class="button" style="float:right" />
									</li>
									<li class="first">
										Create <input type="text" value="10" name="n" size="4" /> 
										<select name="quota">
											<option value="1">One-time </option>
											<option value="0">Multi-use</option>
										</select>
										vouchers for
										<select name="expire">
											<option value="480">8 hours</option>
											<option value="1440">24 hours</option>
											<option value="2880">2 days</option>
											<option value="4320">3 days</option>
											<option value="5760">4 days</option>
											<option value="10080">7 days</option>
											<option value="custom">User-defined</option>
										</select>
										<span class="customExpire">
											<input name="expireNumber" value="1" type="text" class="text-input" size="4" />
											<select name="expireUnit">
												<option value="1">minute</option>
												<option value="60">hour</option>
												<option value="1440" selected="selected">day</option>
											</select>
										</span>
										<span>
											<input type="checkbox" class="check-box-input" name="doNote" />
											<span class="label">Add Notes</span>
											<span class="doNote" style="display:none">
												<input name="note" value="" type="text" class="text-input" size="40" />								
											</span>
										</span>
									</li>
								</ol>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
			
			<div id="Payments" class="tab-wrapper-scrollable">
				<div class="tab-content">
					<div class="section-title ui-dark"><fmt:message key="HS_PaymentTabTitle" />
						<span class="actions">
							<label>Page Size</label>
							<select class="table-pagesizer"></select>
						</span>
					</div>
					<div class="datatable-container">
						<div class="controlBar">
							<form>
								<fieldset>
									<ol>
										<li class="control by-time" style="float:right">
											<fmt:message key="HS_FilterWithin" /> 
											<select class="time-filter"></select>
										</li>
										<li class="control first">
											<input id="PaymentTableSearch" class="text search" type="text" />
										</li>
									</ol>
								</fieldset>
							</form>
						</div>
						<div id="PaymentTableContainer-none" class="empty-message-container content ui-corner-all">
							<p><fmt:message key="HS_NoPayments" /></p>
						</div>
						<div id="PaymentTableContainer"></div>
					</div>
				</div>
			</div>
			<% if (showOperatorTab) { %>
			<div id="Operators" class="tab-wrapper-scrollable">
				<div class="tab-content">
					<div class="section-title ui-dark"><fmt:message key="HS_AccountsTabTitle" />
						<span class="actions">
							<label>Page Size</label>
							<select class="table-pagesizer"></select>
						</span>
					</div>
					<div class="datatable-container">
						<div class="controlBar">
							<form>

								<fieldset>
									<ol>
										<li class="control first">
											<label><fmt:message key="Search" /></label>
											<input id="OperatorTableSearch" class="text search" type="text" />
										</li>
									</ol>
								</fieldset>
							</form>
						</div>
						<div id="OperatorTableContainer-none" class="empty-message-container content ui-corner-all">
							<p><fmt:message key="HS_NoAccounts" /></p>
						</div>
						<div id="OperatorTableContainer"></div>
					</div>
					<div class="controlBar bottom  ui-corner-all">
						<form class="create">
							<fieldset>
								<ol>
									<li class="control right">
										<input type="submit" value="<fmt:message key="HS_CreateAccount" />" name="create" class="button" style="float:right" />
									</li>
									<li class="control first">
										Account <input type="text" value="" name="name" size="15" />
									</li>
									<li class="control">
										Password <input type="text" value="" name="password" size="15" />
									</li>
									<li class="control">
										Note <input type="text" value="" name="note" size="30" />
									</li>
								</ol>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
			<% } %>
		</div>
	</div>
</body>
</html>
</fmt:bundle>
