<%@ page errorPage="errorPage.jsp" language="java" session="true" contentType="text/html;charset=ISO-8859-2"%>
<%@ page import="com.etixpert.evolution.gui.servlets.*"%>
<%@ page pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ include file="header.jsp" %>
<%
    response.setContentType("text/html; charset=iso-8859-2");
    request.setCharacterEncoding("ISO-8859-2");

	//first call

%>
<SCRIPT LANGUAGE="JavaScript">
<!-- JavaScript code hiding

	function simpleLink(origLink) {
		parent.mainFrame.location = origLink;
	}


	function link(origLink){
		if (top.mainFrame.document.forms.length == 0) {
			simpleLink(origLink);
			return;
		}
		else {
			if (top.mainFrame.document.forms[0].saveState == null) {
				simpleLink(origLink); 
				return;
			}
			top.mainFrame.document.forms[0].saveState.value = top.mainFrame.self.location.pathname;
			top.mainFrame.document.forms[0].link.value = origLink;
			top.mainFrame.document.forms[0].submit();
		}
	}
		
// -->
</SCRIPT>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<%
	boolean admin = false;
	boolean distributor = false;
	boolean customer = false;
	boolean specialAgent = false;
	
	org.apache.log4j.Logger l = MainControl.logger;
	
	if	(session.getAttribute("specialAgent")!=null) specialAgent = true;
	if	(session.getAttribute("admin")!=null) admin = true;
	if	(session.getAttribute("customer")!=null) customer = true;
	if	(session.getAttribute("distributor")!=null) distributor = true;
		
	l.info("menu: "+specialAgent+" "+admin);	
%>
<head>
	<link rel="StyleSheet" href="dtree.css" type="text/css" />
	<script type="text/javascript" src="dtree.js"></script>

</head>
<body>
&nbsp;Benutzer:&nbsp;<%=session.getAttribute("USER_LOGGED_LASTNAME")%><br>
&nbsp;Benutzer ID:&nbsp;<%=session.getAttribute("USER_LOGGED_ID")%><br><br>
<div class="dtree">
	<script type="text/javascript">
		<!--
		d = new dTree('d');
		d.add(0,-1,'Evolution');
		<% if (admin) {%>d.add(1,0,'Vertriebspartner');<%}%>
		<% if (admin) {%>d.add(2,0,'Kunde');<%}%>
		d.add(3, 0,'Genealogie', 'organization.jsp', '', 'mainFrame');
		<% if (admin) {%>d.add(4,0,'Artikel');<%}%>
		d.add(5,0,'Bestellungen');
		<% if (admin) {%>d.add(6,0,'Administration');<%}%>
		<% if (admin) {%>d.add(7,0,'Bonus');<%}%>
		<% if (admin) {%>d.add(8,0,'Statistik');<%}%>
	 	
		<% if (admin || specialAgent || !customer) {%>d.add(9,0,'Newsletter');<%}%>
		

		//<% if (admin) {%>d.add(11, 1, 'Neu', 'javascript:link(\'process/new_user_detail_personal.jsp\');', '', 'mainFrame');<%}%>
		<% if (admin) {%>d.add(11, 1, 'Neu', 'process/new_user_detail_personal.jsp', '', 'mainFrame');<%}%>		
		//<% if (admin) {%>d.add(12, 1, 'Stammdaten', 'javascript:link(\'process/user_detail_personal.jsp\');', '', 'mainFrame');<%}%>
		<% if (admin) {%>d.add(12, 1, 'Stammdaten', 'process/user_detail_personal.jsp', '', 'mainFrame');<%}%>

		<% if (admin) {%>d.add(13, 2, 'Neu', 'new_customer_detail_personal.jsp', '', 'mainFrame');<%}%>
		<% if (admin) {%>d.add(14, 2, 'Stammdaten', 'javascript:link(\'process/customer_detail_personal.jsp\');', '', 'mainFrame');<%}%>

		<% if (admin) {%>d.add(15, 4, 'Neu', 'javascript:link(\'process/new_article.jsp\');', '', 'mainFrame');		<%}%>
		<% if (admin) {%>d.add(16, 4, 'Suche/Liste', 'javascript:link(\'article_list.jsp\');', '', 'mainFrame');		<%}%>
		<% if (admin) {%>d.add(17, 4, 'Details', 'javascript:link(\'process/article_detail.jsp\');', '', 'mainFrame');		<%}%>
		//<% if (admin) {%>d.add(18, 4, 'Artikelgruppen', 'article_group.html', '', 'mainFrame');		<%}%>

		<% if (admin || specialAgent) {%>d.add(19, 5, 'Neu', 'process/new_order_person_select.jsp', '', 'mainFrame');<%}%>
		
		<% if (distributor || customer) {%>d.add(19, 5, 'Neu', 'process/new_order.jsp?pageAction=start_new_order&saveState=nothing&link=process/new_order.jsp&cnr=<%=session.getAttribute("USER_LOGGED_ID")%>', '', 'mainFrame');<%}%>
		
		//<% if (admin || specialAgent) {%>d.add(20, 5, 'Suche/List', 'list_search_orders.html', '', 'mainFrame');		<%}%>
		<% if (admin || specialAgent) {%>d.add(21, 5, 'Bestellung modifiz.', 'process/order_selection.jsp', '', 'mainFrame');<%}%>
		<% if (admin || specialAgent) {%>d.add(22, 5, '10 Bestell. akzept.', 'process/list_orders.jsp?status=10&saveState=list_orders.jsp&link=process/list_orders.jsp', '', 'mainFrame');	<%}%>	
		<% if (admin || specialAgent) {%>d.add(23, 5, '20 Betrag einford.', 'process/list_orders.jsp?status=20&saveState=list_orders.jsp&link=process/list_orders.jsp', '', 'mainFrame');	<%}%>	
		<% if (admin || specialAgent) {%>d.add(24, 5, '30 Zahlung kontroll.', 'process/list_orders.jsp?status=30&saveState=list_orders.jsp&link=process/list_orders.jsp', '', 'mainFrame');	<%}%>	
		<% if (admin || specialAgent) {%>d.add(25, 5, '40 Rechnung erstellen', 'process/list_orders.jsp?status=40&saveState=list_orders.jsp&link=process/list_orders.jsp', '', 'mainFrame');	<%}%>	
		<% if (admin || specialAgent) {%>d.add(26, 5, '50 Bestell. auslief.','process/list_orders.jsp?status=50&saveState=list_orders.jsp&link=process/list_orders.jsp', '', 'mainFrame'); <%}%>
		
		<% if (admin) {%>d.add(27, 6, 'Einstellungen','options_country.jsp', '', 'mainFrame');<%}%>
		//<% if (admin) {%>d.add(28, 6, 'Bonuseinstellungen','bonus_options.html', '', 'mainFrame');<%}%>
		//<% if (admin) {%>d.add(29, 6, 'Aktionen', 'actions.html', '', 'mainFrame');<%}%>
		//<% if (admin) {%>d.add(30, 6, 'Werbungen', 'campaign.html', '', 'mainFrame');<%}%>

		<% if (admin) {%>d.add(31, 7, 'Berechnung', 'bonus.jsp', '', 'mainFrame');<%}%>
		//<% if (admin) {%>d.add(32, 7, 'Definition', 'bonus_definition.html', '', 'mainFrame');<%}%>

		<% if (admin) {%>d.add(33, 8, 'Downline Etiketten', 'process/downline_etiketten.jsp', '', 'mainFrame');<%}%>
		<% if (admin) {%>d.add(34, 8, 'Lieferscheinsummen', 'process/lieferschneinsummen.jsp', '', 'mainFrame');<%}%>

		<% if (admin || specialAgent || !customer) {%>d.add(35, 9, 'Neu', 'process/newsletter.jsp', '', 'mainFrame');<%}%>
		//<% if (admin) {%>d.add(36, 9, 'Archiv', '', '', 'mainFrame');<%}%>

		<% if (admin) {%>d.add(37, 0, 'Schnellsuche', '', '', 'mainFrame');<%}%>
		//d.add(38, 36, '<input type=\"text\" columns=\"7\">');
		<% if (admin) {%>d.add(38, 37, 'Suche', 'process/distributor_search.jsp', '', 'mainFrame');<%}%>
		
		<% if (admin || specialAgent) {%>d.add(39, 5, '60 Ausgelief. Best.', 'process/list_orders.jsp?status=60&search=false&saveState=list_orders.jsp&link=process/list_orders.jsp?search=false', '', 'mainFrame');<%}%>
		<% if (admin || specialAgent) {%>d.add(40, 5, '90 Stornierte Best.', 'process/list_orders.jsp?status=90&search=false&saveState=list_orders.jsp&link=process/list_orders.jsp?search=false', '', 'mainFrame');<%}%>
		<% if (admin) {%>d.add(41, 5, 'Bankeinzug-Dateien', 'process/download_files.jsp', '', 'mainFrame');<%}%>
		<% if (!specialAgent) {%>d.add(42, 0, 'Passwort&auml;nderung', 'process/password_person_selection.jsp', '', 'mainFrame');<%}%>			


		<% if (admin) {%>d.add(44, 8, 'Tagesproduktion', 'process/tages_produktion.jsp', '', 'mainFrame');<%}%>
		<% if (admin) {%>d.add(45, 8, 'Umsatzproduktion', 'process/umsatzproduktion.jsp', '', 'mainFrame');<%}%>
		<% if (admin) {%>d.add(46, 8, 'Umsatzsteuervoranm.', 'process/umsatzsteuervoranmeldung.jsp', '', 'mainFrame');<%}%>

		d.add(100,0,'Abmelden', 'logout.jsp', '', '_top');

		document.write(d);

		//-->
	</script>
</div>
</body>
</html>