<?php
require_once 'app/class-user-manager.php';
$usermanager = new UserManager();

?>

<!-- Sidebar -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
	<!-- Brand and toggle get grouped for better mobile display -->
	<div class="navbar-header">
		<button type="button" class="navbar-toggle" data-toggle="collapse"
			data-target=".navbar-ex1-collapse">
			<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span>
			<span class="icon-bar"></span> <span class="icon-bar"></span>
		</button>
		<a class="navbar-brand" href="<?= __SITEBASE ?>">MoSy</a>
	</div>

<<<<<<< .mine
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">
	       
          <ul class="nav navbar-nav side-nav">
          	
          	<li class="dropdown">
          		<a href="#" class="dropdown-toggle" data-toggle="dropdown">
          		<i class="fa fa-wrench"></i> <?= R('menu_general_settings') ?> <b class="caret"></b></a>
          		<ul class="dropdown-menu">
                <li>
                	<a href="<?=__SITEBASE ?>/languages/list_resources"><?= R('menu_translate') ?> </b></a>
                </li>
              </ul>
            </li> 
            <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <i class="fa fa-edit"></i> <?= R('menu_data_agreements') ?> <b class="caret"></b></a>
           
            <ul class="dropdown-menu">
                <li><a href="<?= __SITEBASE ?>/commonmodel"><?= R('menu_view_cm') ?></a></li>
                <li><a href="<?= __SITEBASE ?>/nationalprofile"><?= R('menu_view_npda') ?></a></li>
                <li><a href="#"><?= R('menu_edit_dpas') ?></a></li>
              </ul>
          	</li>
            <li><a href="<?= __SITEBASE ?>/organizations"><i class="fa fa-users"></i> <?= R('menu_organisations') ?></a></li>
            <li><a href="<?= __SITEBASE ?>/users"><i class="fa fa-user"></i> <?= R('menu_users') ?></a></li>
              <li><a target="_blank" href="<?=__SITEBASE ?>/websig"> <i class="fa fa-globe"></i> <?= R('menu_websig') ?></a></li>
            <li><a href="<?= __SITEBASE ?>/auditing"><i class="fa fa-gear"></i> <?= R('menu_auditing') ?></a></li>
          </ul>
          <ul class="nav navbar-nav navbar-right navbar-user">
        	 <li class="dropdown user-dropdown">
        	 <?php  
        	
               $userroles = $usermanager->get_user_roles();
			   $activeuserrole = $usermanager->get_active_userrole();
               ?>
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?= D($activeuserrole->role_descriptioncode) ?> <i class="fa"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
               	<?php for($i=0;$i<count($userroles);$i++) { 
               			if($activeuserrole->roleid != $userroles[$i]->roleid) { ?>
               	
              	<li><a href="<?= __SITEBASE ?>/index/role?id=<?= $userroles[$i]->roleid ?>"><?= D($userroles[$i]->role_descriptioncode) ?></a></li>
                <?php 	}
               		 }	?>
=======
	<!-- Collect the nav links, forms, and other content for toggling -->
	<div class="collapse navbar-collapse navbar-ex1-collapse">

		<ul class="nav navbar-nav side-nav">

			<li class="dropdown"><a href="#" class="dropdown-toggle"
				data-toggle="dropdown"> <i class="fa fa-wrench"></i> <?= R('menu_general_settings') ?> <b
					class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="<?=__SITEBASE ?>/settings"><?= R('menu_settings') ?> </b></a>
					</li>
					<li><a href="<?=__SITEBASE ?>/languages/list_resources"><?= R('menu_translate') ?> </b></a>
					</li>
				</ul></li>
			<li class="dropdown"><a href="#" class="dropdown-toggle"
				data-toggle="dropdown"> <i class="fa fa-edit"></i> <?= R('menu_data_agreements') ?> <b
					class="caret"></b></a>

				<ul class="dropdown-menu">
					<li><a href="<?= __SITEBASE ?>/commonmodel"><?= R('menu_view_cm') ?></a></li>
					<li><a href="<?= __SITEBASE ?>/nationalprofile"><?= R('menu_view_ndp') ?></a></li>
					<li><a href="#"><?= R('menu_edit_lp') ?></a></li>
					<li><a href="#"><?= R('menu_edit_dpa') ?></a></li>
				</ul></li>
			<li class="dropdown"><a href="#" class="dropdown-toggle"
				data-toggle="dropdown"> <i class="fa fa-users"></i> <?= R('menu_organisations_users') ?> <b
					class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="<?= __SITEBASE ?>/organizations"><?= R('menu_organisations') ?></a></li>
					<li><a href="<?= __SITEBASE ?>/"><?= R('menu_users') ?></a></li>
				</ul></li>
			<li class="dropdown"><a href="#" class="dropdown-toggle"
				data-toggle="dropdown"> <i class="fa fa-bars"></i> <?= R('menu_data_records') ?> <b
					class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="<?= __SITEBASE ?>/collectdata"><?= R('menu_collect') ?></a></li>
					<li><a href="<?= __SITEBASE ?>/analysedata"><?= R('menu_analyse') ?></a></li>
					<li><a href="<?= __SITEBASE ?>/publishdata"><?= R('menu_publish') ?></a></li>
				</ul>
				</li>
			<li class="dropdown"><a href="#" class="dropdown-toggle"
				data-toggle="dropdown"> <i class="fa fa-tags"></i> <?= R('menu_duplicate_records') ?> <b
					class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="#"><?= R('menu_clusters') ?></a></li>
					<li><a href="#"><?= R('menu_duplicates') ?></a></li>
					<li><a href="#"><?= R('menu_recordsets') ?></a></li>
				</ul></li>
			<li class="dropdown"><a href="#" class="dropdown-toggle"
				data-toggle="dropdown"> <i class="fa fa-gear"></i> <?= R('menu_auditing') ?> <b
					class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="<?= __SITEBASE ?>/auditing"><?= R('menu_security_audit') ?></a></li>
					<li><a href="<?= __SITEBASE ?>/auditing"><?= R('menu_data_audit') ?></a></li>
				</ul></li>
		</ul>
		<ul class="nav navbar-nav navbar-right navbar-user">
			<li class="dropdown user-dropdown"><a href="#"
				class="dropdown-toggle" data-toggle="dropdown"><i class="fa"></i><?= R('menu_roles') ?><b
					class="caret"></b></a>
				<ul class="dropdown-menu">
               	<?php
																$userroles = UserManager::get_user_roles ();
																foreach ( $userroles as $userrole ) {
																	?>
              	<li><a href="#"><?= D($userrole->role_descriptioncode) ?></a></li>
                <?php }?>
>>>>>>> .r198
<<<<<<< .mine
              </ul>
            </li>
            <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-globe"></i> language <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li>test</li>
              </ul>
            </li>
            <li class="dropdown alerts-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bell"></i> Alerts <span class="badge">3</span> <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#">Default <span class="label label-default">Default</span></a></li>
                <li><a href="#">Primary <span class="label label-primary">Primary</span></a></li>
                <li><a href="#">Success <span class="label label-success">Success</span></a></li>
                <li><a href="#">Info <span class="label label-info">Info</span></a></li>
                <li><a href="#">Warning <span class="label label-warning">Warning</span></a></li>
                <li><a href="#">Danger <span class="label label-danger">Danger</span></a></li>
                <li class="divider"></li>
                <li><a href="#">View All</a></li>
              </ul>
            </li>
            <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <?= $_SESSION['fullname'] ?> <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#"><i class="fa fa-user"></i> Profile</a></li>
                <li><a href="#"><i class="fa fa-envelope"></i> Inbox <span class="badge">7</span></a></li>
                <li><a href="#"><i class="fa fa-gear"></i> Settings</a></li>
                <li class="divider"></li>
                <li><a href="<?= __SITEBASE ?>/index/logout"><i class="fa fa-power-off"></i> Log Out</a></li>
              </ul>
            </li>
          </ul>
        </div><!-- /.navbar-collapse -->
      </nav>=======
              </ul></li>
			<li class="dropdown user-dropdown"><a href="#"
				class="dropdown-toggle" data-toggle="dropdown"><i
					class="fa fa-globe"></i>language<b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li>test</li>
				</ul></li>
			<li class="dropdown alerts-dropdown"><a href="#"
				class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bell"></i>
					Alerts <span class="badge">3</span> <b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="#">Default <span class="label label-default">Default</span></a></li>
					<li><a href="#">Primary <span class="label label-primary">Primary</span></a></li>
					<li><a href="#">Success <span class="label label-success">Success</span></a></li>
					<li><a href="#">Info <span class="label label-info">Info</span></a></li>
					<li><a href="#">Warning <span class="label label-warning">Warning</span></a></li>
					<li><a href="#">Danger <span class="label label-danger">Danger</span></a></li>
					<li class="divider"></li>
					<li><a href="#">View All</a></li>
				</ul></li>
			<li class="dropdown user-dropdown"><a href="#"
				class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <?= $_SESSION['fullname'] ?> <b
					class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="#"><i class="fa fa-user"></i> Profile</a></li>
					<li><a href="#"><i class="fa fa-envelope"></i> Inbox <span
							class="badge">7</span></a></li>
					<li><a href="#"><i class="fa fa-gear"></i> Settings</a></li>
					<li class="divider"></li>
					<li><a href="<?= __SITEBASE ?>/index/logout"><i
							class="fa fa-power-off"></i> Log Out</a></li>
				</ul></li>
		</ul>
	</div>
	<!-- /.navbar-collapse -->
</nav>>>>>>>> .r198
