<?php 
//PENDING COUNT
if($Log_UserType=="1"){
$Select_pending_task="select * from task_mng where status='pending'";
}else{
$Select_pending_task="select * from task_mng where status='pending' and branchid='$Log_UserBranchID'";
}
$fetch_pending_task=mysqli_query($db_conn,$Select_pending_task);
$num_pending_task=mysqli_num_rows($fetch_pending_task);

//COMPLETED COUNT
if($Log_UserType=="1"){
$Select_completed_task="select * from task_mng where status='completed'";
}else{
$Select_completed_task="select * from task_mng where status='completed' and branchid='$Log_UserBranchID'";	
}
$felect_completed_task=mysqli_query($db_conn,$Select_completed_task);
$num_completed_task=mysqli_num_rows($felect_completed_task);

//FOLLOWUP COUNT
if($Log_UserType=="1"){
$Select_followup_task="select * from task_mng where status='followup'";
}else{
$Select_followup_task="select * from task_mng where status='followup' and branchid='$Log_UserBranchID'";	
}
$fetch_followup_task=mysqli_query($db_conn,$Select_followup_task);
$num_followup_task=mysqli_num_rows($fetch_followup_task);
?>
<header class="header fixed-top clearfix">
<!--logo start-->
<div class="brand">
    <a href="landing" class="logo">
        <!---Task---><img src="images/logo.jpg" style="border-radius:5px;"/>
    </a>
    <div class="sidebar-toggle-box">
        <div class="fa fa-bars"></div>
    </div>
</div>
<!--logo end-->
<div class="nav notify-row" id="top_menu">
    <!--  notification start -->
	
	<?php if($Log_UserType=="18"){ ?>
    <ul class="nav top-menu">
        <!-- settings start -->
        <li class="dropdown">
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                <i class="fa fa-tasks"></i>
                <span class="badge bg-important"><?=$num_pending_task;?></span>
            </a>
            <ul class="dropdown-menu extended tasks-bar">
                <li>
                    <p class="">You have <?=$num_pending_task;?> pending tasks</p>
                </li>
				<?php /*
while($show_pending_task=mysqli_fetch_array($fetch_pending_task))
{
?>
                <li>
                    <a href="#">
                        <div class="task-info clearfix">
                            <div class="desc pull-left">
                                <h5><?=substr($show_pending_task['task'],0,25);?>..</h5>
                                <p><?=date("d/M/Y",strtotime($show_pending_task['start_date']));?></p>
                            </div>
                                    <span class="notification-pie-chart pull-right" data-percent="45">
                            <span class="percent"></span>
                            </span>
                        </div>
                    </a>
                </li>
<?php } */ ?>
                <li class="external">
                    <a href="landing">See All Tasks</a>
                </li>
            </ul>
        </li>
        <!-- settings end -->
        <!-- inbox dropdown start-->
        <?php /*?>
		<li id="header_inbox_bar" class="dropdown">
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                <i class="fa fa-envelope-o"></i>
                <span class="badge bg-important">4</span>
            </a>
            <ul class="dropdown-menu extended inbox">
                <li>
                    <p class="red">You have 4 Mails</p>
                </li>
                <li>
                    <a href="#">
                        <span class="photo"><img alt="avatar" src="images/3.png"></span>
                                <span class="subject">
                                <span class="from">Jonathan Smith</span>
                                <span class="time">Just now</span>
                                </span>
                                <span class="message">
                                    Hello, this is an example msg.
                                </span>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <span class="photo"><img alt="avatar" src="images/1.png"></span>
                                <span class="subject">
                                <span class="from">Jane Doe</span>
                                <span class="time">2 min ago</span>
                                </span>
                                <span class="message">
                                    Nice admin template
                                </span>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <span class="photo"><img alt="avatar" src="images/3.png"></span>
                                <span class="subject">
                                <span class="from">Tasi sam</span>
                                <span class="time">2 days ago</span>
                                </span>
                                <span class="message">
                                    This is an example msg.
                                </span>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <span class="photo"><img alt="avatar" src="images/2.png"></span>
                                <span class="subject">
                                <span class="from">Mr. Perfect</span>
                                <span class="time">2 hour ago</span>
                                </span>
                                <span class="message">
                                    Hi there, its a test
                                </span>
                    </a>
                </li>
                <li>
                    <a href="#">See all messages</a>
                </li>
            </ul>
        </li>
		<?php */?>
        <!-- inbox dropdown end -->
        <!-- notification dropdown start-->
		<?php /*?>
        <li id="header_notification_bar" class="dropdown">
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">

                <i class="fa fa-bell-o"></i>
                <span class="badge bg-warning">3</span>
            </a>
            <ul class="dropdown-menu extended notification">
                <li>
                    <p>Notifications</p>
                </li>
                <li>
                    <div class="alert alert-info clearfix">
                        <span class="alert-icon"><i class="fa fa-bolt"></i></span>
                        <div class="noti-info">
                            <a href="#"> Server #1 overloaded.</a>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="alert alert-danger clearfix">
                        <span class="alert-icon"><i class="fa fa-bolt"></i></span>
                        <div class="noti-info">
                            <a href="#"> Server #2 overloaded.</a>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="alert alert-success clearfix">
                        <span class="alert-icon"><i class="fa fa-bolt"></i></span>
                        <div class="noti-info">
                            <a href="#"> Server #3 overloaded.</a>
                        </div>
                    </div>
                </li>

            </ul>
        </li>
		<?php */?>
        <!-- notification dropdown end -->
    </ul>
	<?php }?>
    <!--  notification end -->
</div>
<div class="top-nav clearfix">
    <!--search & user info start-->
    <ul class="nav pull-right top-menu">
        <li>
          <!-----<input type="text" class="form-control search" placeholder=" Search">--->
        </li>
        <!-- user login dropdown start-->
        <li class="dropdown">
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                <img alt="" src="images/2.png">
                <span class="username"><?=$Log_BranchName;?></span>
                <b class="caret"></b>
            </a>
            <ul class="dropdown-menu extended logout">
                <li><a href="#"><i class=" fa fa-suitcase"></i><?=$LogUserNameGET;?></a>
                <!----<li><a href="#"><i class="fa fa-cog"></i> Settings</a></li>--->
                <li><a href="logout" onClick="return confirm('You sure you want to leave?')"><i class="fa fa-key"></i> Log Out</a></li>
				
            </ul>
        </li>
        <!-- user login dropdown end -->
       
    </ul>
    <!--search & user info end-->
</div>
</header>