<style type="text/css">
    body{
        background-color: #fff;
    }
    .navbar,.dropdown-menu{
         background:#15224f;
        border: none;

    }
    .datepicker.dropdown-menu{
        background:#f5f5f5;
        border: none;

    }

    .nav>li>a, .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover, .dropdown-menu>li>a, .dropdown-menu>li{
        border-bottom: 3px solid transparent;
    }
    .nav>li>a:focus, .nav>li>a:hover,.nav .open>a, .nav .open>a:focus, .nav .open>a:hover, .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover{
        border-bottom: 3px solid transparent;
        background: rgba(154, 154, 154, 0.27);
    }
    .navbar a, .dropdown-menu>li>a, .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover, .navbar-toggle{
        color: #fff;
    }
    .dropdown-menu{
        -webkit-box-shadow: none;
        box-shadow:none;
    }

    .nav li:hover:nth-child(8n+1), .nav li.active:nth-child(8n+1){
        border-bottom: #b6f423 4px solid;
    }
    .nav li:hover:nth-child(8n+2), .nav li.active:nth-child(8n+2){
        border-bottom: #82e2ea 4px solid;
    }
    .nav li:hover:nth-child(8n+3), .nav li.active:nth-child(8n+3){
        border-bottom: #f8b42c 4px solid;
    }
    .nav li:hover:nth-child(8n+4), .nav li.active:nth-child(8n+4){
        border-bottom: #fd594a 4px solid;
    }
    .nav li:hover:nth-child(8n+5), .nav li.active:nth-child(8n+5){
        border-bottom: #e8479d 4px solid;
    }
    .nav li:hover:nth-child(8n+6), .nav li.active:nth-child(8n+6){
        border-bottom: #a12eeb 4px solid;
    }
    .nav li:hover:nth-child(8n+7), .nav li.active:nth-child(8n+7){
        border-bottom: #4785d9 4px solid;
    }
    .nav li:hover:nth-child(8n+8), .nav li.active:nth-child(8n+8){
        border-bottom: #2aed9a 4px solid;
    }

    .navbar-toggle .icon-bar{
        color: #fff;
        background: #000000;
    }
    img {
        width: 50px;
        height: 30px;
    }
    #mira-heading{
        color:white;
        font-size: 22px;
        font-family: Bold;
        position: fixed;
        left: 50%;
        top: 6%;
        transform: translate(-50%, -50%);
        width:350px; 
        height: 60px;
    }
</style>
<?php
$level = $this->session->userdata('level');
$is_user_loged = $this->session->userdata('is_user_loged');
$right = $this->session->userdata('right');
$level_name = $this->session->userdata('level_name');
$logo_url = $this->session->userdata('logo_url');
$totallevel = $this->session->userdata('app_total_level');
?>
<div class="navbar-wrapper">
    <div class="container-fluid">      
         <nav class="navbar navbar-fixed-top" style="border-bottom: #526875 2px solid">

            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <?php if (isset($level) and $level and $logo_url != NULL) { ?>
                    <a class="navbar-brand" href="" aria-expanded="false"><img class="img-rounded" src="<?= base_url($logo_url) ?>"></a>
                <?php } else { ?>
                    
                    <div class="navbar-collapse collapse">
<!--                        <ul class="navbar-center">
                            <li ><h3><strong>Mira Project</strong></h3>
                            </li>
                        </ul>-->
<div id="mira-heading">Roshni Project</div>
                    </div>
                <?php }
                ?>


            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    
                    <?php if (isset($level) and ! $level and $is_user_loged) { ?>
                        <li class="dropdown">
                            <a href ="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span><strong>Application</strong></span><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li class="dropdown"><a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="true" href = <?= base_url('create_app_form') ?>><span><strong>Create Application</strong></span></a></li>
                                <li class="dropdown"><a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('applicationView') ?>><span><strong>Edit/View Application</strong></span></a></li>
                            </ul>
                        </li>
                        <li class="dropdown" >
                            <a href = '#' class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span><strong>Admin User</strong></span><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('admin_create_user_form'); ?>><span><strong>Create User</strong></span></a></li>
                                <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('get_app_right') ?>><span><strong>Add/Update Admin Right</strong></span></a></li>
                                <li class="dropdown"><a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('adminList'); ?>><span><strong>Edit/View Admin</strong></span></a></li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href = '#' class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span><strong>Assign Application</strong></span><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('mapping_app_admin') ?>><span><strong>To Admin</strong></span></a></li>
                                <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('current_status_app') ?>><span><strong>To Activation/Deactivation</strong></span></a></li>
                                <li class="dropdown"><a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('mapped_app_list') ?>><span><strong>View Assigned  App</strong></span></a></li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href ="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span><strong>Add Area</strong></span><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li class="dropdown"><a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="true" href = <?= base_url('country') ?>><span class="glyphicon glyphicon-plus"><strong>Add Country</strong></span></a></li>
                                <li class="dropdown"><a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('state') ?>><span class="glyphicon glyphicon-plus"><strong>Add State</strong></span></a></li>
                                <li class="dropdown"><a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href = <?= base_url('district') ?>><span class="glyphicon glyphicon-plus"><strong>Add District</strong></span></a></li>
                            </ul>
                        </li>
                        <?php
                    } else if ($is_user_loged and isset($right)) {
                        foreach ($right as $item):
                            switch ($item['right_id']) {
                                case 1:
                                    ?>
                                    <li class="dropdown">
                                        <a href="" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><strong>Create Region</strong><span class="caret"></span></a>
                                        <ul class="dropdown-menu">
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('new_region_form'); ?> ><strong>New Region Create</strong></a></li>
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('update_delete'); ?> ><strong>Update Region</strong></a></li>

                                        </ul>
                                    </li>
                                    <li class="dropdown">
                                        <a href="" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><strong>Create User</strong><span class="caret"></span></a>
                                        <ul class="dropdown-menu">
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('new_user_form') ?> ><strong>New  User Create</strong></a></li> 
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('update_user_right') ?> ><strong>Update User Rights</strong></a></li> 
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('user_list') ?> ><strong>Update/Delete User</strong></a></li> 

                                        </ul>
                                    </li>
                                    <li class="dropdown">
                                        <a href="" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><strong>Mapped/Unmapped</strong><span class="caret"></span></a>

                                        <ul class="dropdown-menu">
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('mapping_region_user') ?> ><strong>Mapping Region To User</strong></a></li>
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('mapped_region_list') ?> ><strong>Unmapped Region To User</strong></a></li> 
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('activation_user') ?> ><strong>User Activation</strong></a></li> 
                                            <li class="dropdown"><a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('mapped_user_list') ?> ><strong>Mapped View</strong></a></li> 
                                        </ul>
                                    </li>
                                    <?php
                                    break;

                                case 2:
                                    ?>
                                    <li class="dropdown">
                                        <a href="" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><strong>Report View</strong> <span class="caret"></span></a>
                                        <ul class="dropdown-menu">
                                            <li class="dropdown">
                                                <a class="dropdown-toggle" role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('house_list_view/1') ?> ><strong>House&nbsp;List</strong></a>
                                            </li>
                                            

                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('women_list_view/1') ?> ><strong>Women&nbsp;List</strong></a>  
                                            </li>


                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('child_list_view/1') ?> ><strong>Child&nbsp;List</strong></a>  
                                            </li>
                                      <!--        <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('pregnant_list_view/1') ?> ><strong>Pregnancy&nbsp;Close</strong></a> 
                                            </li>
                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('running-list/1') ?> ><strong>Pregnancy&nbsp;Running</strong></a>  
                                            </li>-->
                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('child_vaccination') ?> ><strong>Child&nbsp;Immunization</strong></a>  
                                            </li>
<!--                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('pregnant_report') ?> ><strong>HRP&nbsp;Tracker</strong></a>  
                                            </li>
                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('child_report/1'); ?> ><strong>Immunization&nbsp;Tracker</strong></a>  
                                            </li>
                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('current_report/1'); ?> ><strong>Running&nbsp;Week&nbsp;HRP</strong></a>  
                                            </li>-->
                                        </ul>
                                    </li>
                                    <?php
                                    break;

                                case 3:
                                   
                                    break;
//                                case 4:
//                                    ?>
                                    <li class="dropdown">
                                        <a href="" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><strong>Immunization</strong> <span class="caret"></span></a>
                                        <ul class="dropdown-menu">
                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=//<?= base_url('immunization_child/1') ?> ><strong>Immunization Child</strong></a>  
                                            </li>

                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=//<?= base_url('immunization_pregnant/1') ?> ><strong>Pregnancy Questionnaire</strong></a>  
                                            </li>


                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=//<?= base_url('pregnancy_close') ?> ><strong>Pregnant Close</strong></a>  
                                            </li>

                                        </ul>
                                    </li>
                                    //<?php
//                                    break;
                                case 5:
                                    ?>
                                    <li class="dropdown">
                                        <a href="" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><strong>Worker Track</strong> <span class="caret"></span></a>
                                        <ul class="dropdown-menu">
                                            <?php if ($totallevel-1==$level) { ?>
                                             <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('asha_wise_data') ?> ><strong>Asha Worker</strong></a>  
                                                
                                            </li>
                                            
                                          <?php } else { ?>
                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('asha_wise_data') ?> ><strong>Asha Worker</strong></a>
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('vaccination_data') ?> ><strong>Mira wise Graph</strong></a> 
                                              <!--   <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('actualdate_house') ?> ><strong>Update House</strong></a> 
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('actualdate_women') ?> ><strong>Update Women</strong></a> 
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('actualdate_child') ?> ><strong>Update Child</strong></a> 
                                              -->
                                        
                                        
                                        
                                            </li>
<!--                                            <li class="dropdown">
                                                <a class="dropdown-toggle"  role="button" aria-haspopup="true" aria-expanded="false" href=<?= base_url('anm_worker') ?> ><strong>ANM Worker</strong></a>  
                                            </li>-->
                                           
                                            <?php }
                                             ?>
                                        </ul>
                                    </li>
                                    <?php
                                    break;
                            }


                        endforeach;
                    }
                    ?>

                </ul>
                <?php if ($is_user_loged) { ?> 
                    <ul class="nav navbar-nav pull-right" style="margin-right: 42px">
                        <li class=" dropdown"><a href="#" class="dropdown-toggle active" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><strong>Signed in as</strong><span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href=<?= base_url('password') ?>><span><i class="fa fa-key" aria-hidden="true"><strong>&nbsp;Change Pass</strong></i></span></a></li>
                                <li><a href=<?= base_url('profile') ?>><span><i class="fa fa-user"><strong>&nbsp;User&nbsp;Profile</strong></i></span></a></li>
                                <li><a href=<?= base_url('logout') ?>><span class="text-center text-danger"><i class="fa fa-sign-out"><strong>&nbsp;LogOut</strong></i></span></a></li>
                            </ul>
                        </li>                    
                    </ul>
                <?php } ?>

            </div>                 
        </nav>
    </div>
</div>