<%@include file="include/zop,header.jsp"%>
<%
//-----------------------------------------------
// Set permission for this page.
permission.addOperator();

//Check permission.
if(!checkPermission()){
	return;
}

// Create data access object.
CategorySystemDao dao = new CategorySystemDao();
CategoryCustomDao dao2 = new CategoryCustomDao();

// Global.
int gCount = dao.selectCount() + dao2.selectCount();
%>

<!-- view -->
<form>
<fieldset>
<legend>SYSTEM CATEGORY</legend>
<table class="view">

	<tr>
		<td>
System categories for domain classification.
		</td>
	</tr>

</table>
</fieldset>
</form>
<!-- /view -->

<!-- list -->
<table width="100%">
	<tr>
		<td>
			Count : <%= gCount%>
		</td>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="list-head">
		<td width="200">&nbsp;Name</td>
		<td width="">Description</td>
	</tr>

<%
List<CategoryData> dataList = dao.selectList();

// Add custom categories.
dataList.addAll(dao2.selectList());

if(dataList.isEmpty()){
	out.println("<tr class='row'>");
	out.println("<td colspan='2' align='center'>No data</td>");
	out.println("</tr>");
}

for(int i = 0; i < dataList.size(); i++){
	CategoryData data = dataList.get(i);

	if(i > 0){
		out.println("<tr class='line'><td colspan='2'></td></tr>");
	}
%>
	<tr class="row">
		<td width="200"><%= data.name%></td>
		<td><%= data.description%></td>
	</tr>
<%}%>

	<tr class="line"><td colspan="2"></td></tr>
</table>
</div>
<!-- /list -->

<%@include file="include/zop,footer.jsp"%>
