<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<?php
include_http_metas();
include_metas();
include_title();

use_javascript('main.js');
use_javascript('ie-hover-pack.js');

?>
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
	<link rel="shortcut icon" href="/favicon.ico" />
	<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="/css/lt7-admin.css" /><![endif]-->
</head>
<body>

<div class="main">
	<div id="header">
		<div class="header-top"></div>
		<div class="header-center">
			<div class="header-add">
				<div class="header-add01">
					<strong class="logo"><a href="<?php echo url_for('@homepage') ?>" title="Accueil">Accueil</a></strong>
				<?php if ('sol-violette' != sfConfig::get('sf_environment')): ?>
					<div class="header-box">
						<div class="center">
							<div>
								<p>Depuis le <span class="date01"><?php echo Utils::getKataoStartDate() ?></span>, les <span class="date01"><?php echo Utils::getKataoMembersCount() ?></span> adhérents du réseau ont réalisé</p>
								<p><span class="date01"><?php echo Utils::getKataoTransactionsCount() ?></span> transactions pour un montant total de <span class="date01"><?php echo Utils::getKataoTransactionsSum() ?></span></p>
							</div>
						</div>
						<div class="bottom"></div>
					</div>
				<?php endif ?>
				</div>
			</div>
		</div>
		<div class="header-bottom">
		<?php if ($sf_user->isAuthenticated()) : ?>
			<ul id="nav">
			<?php if ($sf_user->hasCredential(array('admin', 'seo', 'supplier', 'delegate', 'referer'), false)): ?>
				<li class="<?php echo ('user' == $sf_request->getParameter('module') && !in_array($sf_request->getParameter('action'), array('profile', 'profileGmap')))?'active':'' ?>"><?php echo link_to('Accueil', '@homepage') ?></li>
			<?php endif ?>
			<?php if ($sf_user->hasCredential(array('admin', 'seo', 'delegate'), false)): ?>
				<li class="<?php echo in_array($sf_request->getParameter('module'), array('kataoMember', 'kataoMemberDeposit', 'mailing'))?'active':'' ?>"><?php echo link_to('Adhérents', '@katao_member') ?></li>
			<?php endif ?>
			<?php if ($sf_user->hasCredential(array('admin', 'seo', 'delegate', 'referer'), false)): ?>
				<li class="<?php echo ('kataoSupplier' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Fournisseurs', '@katao_supplier') ?></li>
			<?php endif ?>
			<?php if ($sf_user->hasCredential(array('admin', 'seo', 'supplier', 'delegate', 'referer'), false)): ?>
				<li class="<?php echo ('kataoProduct' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Produits', '@katao_product') ?></li>
			<?php endif ?>
			<?php if ($sf_user->hasCredential(array('admin', 'seo', 'delegate'), false)): ?>
				<li class="<?php echo in_array($sf_request->getParameter('module'), array('kataoCart', 'kataoOrder', 'kataoSupplierInvoice', 'kataoInvoice'))?'active':'' ?>"><?php echo link_to('Distribution', '@katao_cart') ?></li>
			<?php endif ?>
			<?php if ($sf_user->hasCredential(array('admin', 'seo', 'delegate'), false)): ?>
				<li class="<?php echo in_array($sf_request->getParameter('module'), array('kataoNode', 'kataoPeriod', 'kataoProductFamily', 'kataoProductCategory', 'kataoConfig' , 'kataoMemberGroup'))?'active':'' ?>"><?php echo link_to('Administration', '@katao_node') ?></li>
			<?php endif ?>
			<?php if ($sf_user->hasCredential(array('supplier'), false)): ?>
				<li class="<?php echo ('user' == $sf_request->getParameter('module') && in_array($sf_request->getParameter('action'), array('profile', 'profileGmap')))?'active':'' ?>"><?php echo link_to('Mon profil', '@profile') ?></li>
			<?php endif ?>
			</ul>
		<?php endif ?>
		</div>
	</div>
	<div class="col-count03">
		<div class="col-count02">
			<div id="page-content">
				<?php include_component('wpFlashMessages', 'display') ?>
				<?php echo $sf_content ?>
			</div>
		</div>
		<div class="left">
		<?php if ($sf_user->isAuthenticated() && !in_array($sf_request->getParameter('module'), array('user', 'kataoSupplier', 'kataoProduct'))): ?>
			<div class="subnav">
				<div class="top"></div>
				<div class="center">
					<ul>
					<?php if (in_array($sf_request->getParameter('module'), array('kataoNode', 'kataoPeriod', 'kataoProductFamily', 'kataoProductCategory', 'kataoConfig', 'kataoMemberGroup'))): ?>
						<?php if ($sf_user->hasCredential(array('admin', 'seo', 'delegate'), false)): ?>
						<li class="<?php echo ('kataoNode' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Noeuds', '@katao_node') ?></li>
							<?php if ($sf_user->hasCredential(array('admin', 'seo'), false)): ?>
						<li class="<?php echo ('kataoPeriod' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Périodes', '@katao_period') ?></li>
						<li class="<?php echo ('kataoProductFamily' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Familles', '@katao_product_family') ?></li>
						<li class="<?php echo ('kataoProductCategory' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Rayons', '@katao_product_category') ?></li>
						<li class="<?php echo ('kataoMemberGroup' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Groupes d\'utilisateurs','@katao_member_group') ?></li>
						<li class="<?php echo ('kataoConfig' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Configuration', '@katao_config') ?></li>
							<?php endif ?>
						<?php endif ?>
					<?php elseif (in_array($sf_request->getParameter('module'), array('kataoCart', 'kataoOrder', 'kataoSupplierInvoice', 'kataoInvoice'))): ?>
						<li class="<?php echo ('kataoCart' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Demandes adhérents', '@katao_cart') ?></li>
						<li class="<?php echo ('kataoOrder' == $sf_request->getParameter('module') && in_array($sf_request->getParameter('action'), array('simulated', 'simulatedMembers')))?'active':'' ?>"><?php echo link_to('Commandes simulées', '@katao_order_simulated') ?></li>
						<li class="<?php echo ('kataoOrder' == $sf_request->getParameter('module') && !in_array($sf_request->getParameter('action'), array('simulated', 'simulatedMembers')))?'active':'' ?>"><?php echo link_to('Commandes fournisseurs', '@katao_order') ?></li>
						<li class="<?php echo ('kataoSupplierInvoice' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Factures fournisseurs', '@katao_supplier_invoice') ?></li>
						<li class="<?php echo ('kataoInvoice' == $sf_request->getParameter('module'))?'active':'' ?>"><?php echo link_to('Factures adhérents', '@katao_invoice') ?></li>
					<?php elseif (in_array($sf_request->getParameter('module'), array('kataoMember', 'kataoMemberDeposit', 'mailing'))): ?>
						<li class="<?php echo ('kataoMemberDeposit' == $sf_request->getParameter('module') && !in_array($sf_request->getParameter('action'), array('transferSol', 'transferSolUpdate')))?'active':'' ?>"><?php echo link_to('Dépôts', 'kataoMemberDeposit/index?sort=date&desc=on') ?></li>
						<li class="<?php echo ('kataoMemberDeposit' == $sf_request->getParameter('module') && in_array($sf_request->getParameter('action'), array('transferSol', 'transferSolUpdate')))?'active':'' ?>"><?php echo link_to('Transfert en ' . wpConfig::getAdditionalCurrencyName(), 'kataoMemberDeposit/transferSol') ?></li>
						<li class="<?php echo ('kataoMemberMailing' == $sf_request->getParameter('module') && !in_array($sf_request->getParameter('action'), array('index')))?'active':'' ?>"><?php echo link_to('Mailing', '@katao_member_mailing') ?></li>
						<li class="<?php echo ('kataoMember' == $sf_request->getParameter('module') && !in_array($sf_request->getParameter('action'), array('index')))?'active':'' ?>"><?php echo link_to('Adhésion', '@katao_member_adhesion_showall') ?></li>
					<?php endif ?>
					</ul>
				</div>
				<div class="bottom"></div>
			</div>
			<br />
		<?php endif ?>
		<?php if ($sf_user->isAuthenticated()) : ?>
			<div class="subnav">
				<div class="top"></div>
				<div class="center">
					<fieldset>
						<div class="search-form">
							Bienvenue <?php echo $sf_user->getInstance()->getFullName() ?>
							<br /><a href="<?php echo url_for('@logout') ?>">[se déconnecter]</a>
							<a class="mon-profile" href="<?php echo sfConfig::get('app_katao_frontend_url') ?>" target="_blank">Accéder à la boutique</a>
						</div>
					</fieldset>
				</div>
				<div class="bottom"></div>
			</div>
		<?php endif ?>
		</div>
	</div>
	<div id="footer">
		<ul class="footnav">
			<li>&copy; crédits katao</li>
		</ul>
		<div class="footer-bottom"></div>
	</div>
</div>

</body>
</html>