<?php
$uname = "";
$fl_name = "";
$filepath = "";
$separator = ',';

$stmt_user = $users->UserDetails($_SESSION['uid']);
if ($row_user = $stmt_user->fetch(PDO::FETCH_ASSOC)) {
    extract($row_user);
    $uname = $first_name;
    $fl_name = $user_image;
    $ulname = $last_name;
}
if ($fl_name != "") {
    $filepath = ADMIN_HTTP_PATH . $properties['jdbc.user_image_folder'] . "/" . $fl_name;
} else {
    $filepath = DEFAULT_USER_IMAGE;
}
$cust_company_logo = "";
$cust_company_image_path = "";
$cust_company_name = "";
$cust_company_banner_announcement = "";
$cust_company_banner_reference = "";
$cust_company_banner_survey = "";
$cust_company_banner_image_path_announcement = "";
$cust_company_banner_image_path_reference = "";
$cust_company_banner_image_path_survey = "";
$cust_website_link = "";
$cust_facebook_link = "";
$cust_twitter_link = "";
$cust_linkedin_link = "";
$cust_youtube_link = "";


$stmt_company = $users->UserCompanyDetails($_SESSION['uid']);
if ($row_company = $stmt_company->fetch(PDO::FETCH_ASSOC)) {
    extract($row_company);
    $cust_company_logo = $logo_path;
    $cust_company_name = $name;
    $cust_company_banner_announcement = $banner_path_announcement;
    $cust_company_banner_reference = $banner_path_reference;
    $cust_company_banner_survey = $banner_path_survey;
    $cust_website_link = $website_link;
    $cust_facebook_link = $facebook_link;
    $cust_twitter_link = $twitter_link;
    $cust_linkedin_link = $linkedin_link;
    $cust_youtube_link = $youtube_link;
}
if ($cust_company_logo != "") {
    $cust_company_image_path = ADMIN_HTTP_PATH . $properties['jdbc.comp_image_folder'] . "/" . $cust_company_logo;
}
if ($cust_company_banner_announcement != "") {
    $cust_company_banner_image_path_announcement = ADMIN_HTTP_PATH . $properties['jdbc.comp_image_banner_folder'] . "/" . $cust_company_banner_announcement;
}
if ($cust_company_banner_reference != "") {
    $cust_company_banner_image_path_reference = ADMIN_HTTP_PATH . $properties['jdbc.comp_image_banner_folder'] . "/" . $cust_company_banner_reference;
}

if ($cust_company_banner_survey != "") {
    $cust_company_banner_image_path_survey = ADMIN_HTTP_PATH . $properties['jdbc.comp_image_banner_folder'] . "/" . $cust_company_banner_survey;
}
?>
<!-- preloader start -->
<div class="preloader js-preloader">
    <div class="preloader__bg"></div>
</div>
<!-- preloader end -->
<!-- Fixed navbar -->
<div class="pagewide">
    <div class="container pt-10">
        <div class="col-md-6 pl-0 pr-0">
            <p>
                <i class="fa fa-building fa-lg"></i>
                <?php echo $cust_company_name; ?>
            </p>
        </div>
        <div class="col-md-6 pl-0 pr-0">
            <p id="sub_header_dtl">
                <?php
                if ($row_company['phone_no'] != "") {
                    $val_phone = explode($separator, $row_company['phone_no']);
                    ?>
                    <i class="fa fa-mobile fa-lg"></i> <?php echo trim($val_phone[0]); ?>&nbsp;&nbsp;&nbsp;&nbsp;
                <?php } ?>
                <?php
                if ($row_company['email_id'] != "") {
                    $val_email = explode($separator, $row_company['email_id']);
                    ?>
                    <i class="fa fa-envelope fa-lg"></i>  <?php echo trim($val_email[0]); ?> 
                <?php } ?>

            </p>
        </div>
    </div>
</div>
<nav class="navbar navbar-default sticky" id="navbar_top">
    <div class="container">
        <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>
            <a class="navbar-brand" href="home.php" title="<?php echo $cust_company_name; ?>">
                <?php if ($cust_company_logo != "") { ?>
                    <img src="<?php echo $cust_company_image_path; ?>" alt="<?php echo $cust_company_name; ?>" />
                <?php } ?>
            </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse pl-0 pr-0">
            <ul class="nav navbar-nav navbar-right">
                <li class="<?php
                if ($page_no == 1) {
                    echo "active";
                }
                ?>"><a href="home.php" class="uppercase"><?php echo _("LB0101") ?></a>
                </li>
                <li class="<?php
                if ($page_no == 2 || $page_no == 3) {
                    echo "active";
                }
                ?>"><a href="courses.php" class="uppercase"><?php echo _("LB0102"); ?></a></li>
                <li class="<?php
                if ($page_no == 4) {
                    echo "active";
                }
                ?>"><a href="announcement.php" class="uppercase"><?php echo _("LB0103") ?></a>
                </li>
                <!--check survey-->
                <li class="<?php
                if ($page_no == 10) {
                    echo "active";
                }
                ?>">
                    <a href="survey.php" class="uppercase"><?php echo _("SY0101") ?></a></li>
                <li class="<?php
                if ($page_no == 5) {
                    echo "active";
                }
                ?>">
                    <a href="references.php" class="uppercase"><?php echo _("LB0104") ?></a></li>
                <li class="dropdown <?php
                if ($page_no == 6 || $page_no == 7 || $page_no == 8 || $page_no == 9) {
                    echo "active";
                }
                ?>" >
                    <a href="#" class="dropdown-toggle uppercase" data-toggle="dropdown" role="button"
                       aria-haspopup="true" aria-expanded="false"><?php echo _("LB0105") ?> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li class="<?php
                        if ($page_no == 6) {
                            echo "active";
                        }
                        ?>"><a href="about.php" class="uppercase"><?php echo _("LB0106") ?></a></li>
                        <li class="<?php
                        if ($page_no == 8) {
                            echo "active";
                        }
                        ?>"><a href="faq.php" class="uppercase"><?php echo _("LB0112") ?></a></li>
                        <li class="<?php
                        if ($page_no == 9) {
                            echo "active";
                        }
                        ?>"><a href="forum.php" class="uppercase"><?php echo _("FR0134"); ?></a></li>
                        <li class="<?php
                        if ($page_no == 7) {
                            echo "active";
                        }
                        ?>"><a href="contactus.php" class="uppercase"><?php echo _("LB0107") ?></a></li>
                    </ul>
                </li>
                <li>
                    <!--//page_no 11-->
                    <form class="nosubmit mt-15" method="get" action="search.php" onsubmit="return validateForm()">
                        <input class="nosubmit" type="search" name="s" id="s" placeholder="<?php echo _("HM0120") ?>">
                    </form>
                </li>
                <li class="dropdown <?php
                if ($page_no == 12) {
                    echo "active";
                }
                ?>">
                    <a href="#" class="dropdown-toggle uppercase" data-toggle="dropdown" role="button"
                       aria-haspopup="true" aria-expanded="false">
                        <img class="size-20 rounded-full" src="<?php echo $filepath ?>" alt="image"> <?php echo _("LB0113") ?> <span
                            class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="<?php
                        if ($page_no == 12) {
                            echo "active";
                        }
                        ?>"><a href="profile.php" class="uppercase"><?php echo _("LB0113") ?></a></li>
                        <li><a href="profile.php#languges_tab" class="uppercase"><?php echo _("US0138"); ?></a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="logout.php" class="uppercase"
                               onclick='return confirm("<?php echo _("LG0120") ?>")'><?php echo _("LB0114") ?></a></li>
                    </ul>
                </li>

            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>