<?
$compDets = comp_settings();
//$compContact = comp_contact();
$compContact =$this->compInfo;
//trace($compDets);
//trace($compContact);
//if(is_array($compDets)&& !empty($compDets)){
//


  $catRes = $this->db->query("SELECt * FROM wps_company_categories WHERE status = '1' AND categoryType = '0' AND companyId = '".$compContact['customers_id']."'")->result_array();
  $catResService = $this->db->query("SELECt * FROM wps_company_categories WHERE status = '1' AND categoryType = '1' AND companyId = '".$compContact['customers_id']."'")->result_array();
  $linkManagement = $this->db->query("SELECT * FROM wps_website_link_management WHERE cust_id = '".$compContact['customers_id']."'")->result_array();
  ?>
  <a id="web-pulse-scroll-up" title="Go to Top" ><i class="fa fa-angle-up"></i></a>
  <!-- Header--->
  <header class="web-pulse-header">
    <div class="w-e-b-p-u-l-s-e-topbar">
      <div class="container">
        <div class="row">
          <div class="col-lg-5 col-md-5 col-xs-6">
            <ul class="connect_option">
              <li><a class="login" href="tel:<?php echo $this->mem_mobile_no;?>"><i class="fa fa-phone"></i><?php echo $this->mem_mobile_no;?></a></li>
              
              <?php if(is_array($compDets)&& !empty($compDets)){ ?>
              <li class="social-icon hidden-xs">
                <ul class="social-icons">
                  
                  <li><a class="facebook" title="Facebook" itemprop="url" target="_blank" href="<?php echo (isset($compDets['facebook_link'])) ? $compDets['facebook_link'] : 'javascript:void(0)'; ?>"><i class="fa fa-facebook"></i></a></li>
                  <li><a class="twitter" title="Twitter" itemprop="url" target="_blank" href="<?php echo (isset($compDets['twitter_link'])) ? $compDets['twitter_link'] : 'javascript:void(0)'; ?>"><i class="fa fa-twitter"></i></a></li>
                  <li><a class="linkedin" title="Linkedin" itemprop="url" target="_blank" href="<?php echo (isset($compDets['linkedin_link'])) ? $compDets['linkedin_link'] : 'javascript:void(0)'; ?>"><i class="fa fa-linkedin"></i></a></li>
                  <li><a class="youtube" title="Youtube" itemprop="url" target="_blank" href="<?php echo (isset($compDets['youtube_link'])) ? $compDets['youtube_link'] : 'javascript:void(0)';?>"><i class="fa fa-youtube"></i></a></li>
                </ul>
              </li>
              <?php } ?>
              
              
              
            </ul>
          </div>
          <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6 pull-right">
            <div class="search-bar-holder">
              <div class="search-bar">
                <form method="get" action="<?php echo comp_url(); ?>search">
                  <input type="text" class="form-control" name="keyword" required placeholder="I am looking for...">
                  <button class="search_btn"><i class="fa fa-search"></i></button>
                </form> </div>
            </div>
          </div>

        </div>
      </div>
    </div>
    <div class=webpulse-soluction>
      <div class="container">
        <div class="row">
          <div class="col-lg-3 col-md-3">
            <div class="w-p-s-logo">
              <a itemprop="url" href="<?php echo comp_url(); ?>" title="<?php echo $compContact['company_name']; ?>">
                <?php
                if (isset($compDets['website_logo'])) {
                  ?>
                  <img itemprop="logo" id="logo" src="<?php echo get_image('clients/logo', $compDets['website_logo'], '220', '70', 'R'); ?>" alt="<?php echo $compContact['company_name']; ?>" title="<?php echo $compContact['company_name']; ?>">
                  <?php
                } else {
                  echo ucwords($compContact['company_name']);
                }
                ?>
              </a>
            </div>
          </div>
          <div class="col-lg-9 col-md-9">
            <div class="web-pulse-navigation-wps">
              <div class="navbar">
                <button><i class="fa fa-bars"></i></button>
              </div>
              <div class="web-p-u-l-s-e-menu">
                <ul class="nav">
                  <li class="active"><a itemprop="url" href="<?php echo comp_url(); ?>" title="Home">Home</a></li>

                  <?php if(count($linkManagement)>0 && $linkManagement[0]['company_profile']=='1' || empty($linkManagement)){ ?>
                  <li><a itemprop="url" href="<?php echo comp_url(); ?>about-us" title="Company Profile">Company Profile </a></li>
                <?php } ?>

                <?php 
                if(count($linkManagement)>0 && $linkManagement[0]['our_products']=='1' || empty($linkManagement)){
                  if(is_array($catRes)&&!empty($catRes)){
                    $proCount = $this->db->query("SELECT products_id FROM wps_products WHERE status = '1' ANd customers_id='".$compContact['customers_id']."' AND website_category_id !=''")->num_rows();
                    if($proCount){
                  ?>
                  <li class="cs-submenu"><a itemprop="url" href="<?php echo comp_url(); ?>product-listing" title="Our Products">Our Products <i class="fa fa-angle-down hidden-xs hidden-sm"></i></a> 
                    <ul class="cs-dropdown">
                      <?php
                      foreach ($catRes as $catVal) {
                        $catSub = $this->db->query("SELECT product_name, friendly_url FROM wps_products WHERE status = '1' AND website_category_id = '" . $catVal['category_id'] . "'")->result_array();
                        ?>
                        <li class="cs-submenu">
                          <a itemprop="name" href="<?php echo site_url() . $catVal['friendly_url']; ?>" title="<?php echo $catVal['category_name']; ?>"><?php echo $catVal['category_name']; ?> 
                            <?php
                            if (is_array($catSub) && !empty($catSub)) {
                              ?>
                              <i class="fa fa-angle-right hidden-xs hidden-sm"></i>
                              <?php
                            }
                            ?>
                          </a>
                          <?php
                          if (is_array($catSub) && !empty($catSub)) {
                            ?>
                            <ul class="cs-dropdown">
                              <?php
                              foreach ($catSub as $proVal) {
                                ?>
                                <li><a itemprop="url" href="<?php echo comp_url() . $proVal['friendly_url']; ?>" title="<?php echo $proVal['product_name']; ?>"><?php echo $proVal['product_name']; ?></a></li>
                                <?php
                              }
                              ?>
                            </ul>
                            <?php
                          }
                          ?>
                        </li>
                        <?php
                      }
                      ?>
                    </ul>
                  </li>
                  <?php 
                    }
                  }
                 } ?>

              <?php if(count($linkManagement)>0 && $linkManagement[0]['our_services']=='1' || empty($linkManagement)){ 
                  if(is_array($catRes)&&!empty($catRes)){
                    $serviceCount = $this->db->query("SELECT products_id FROM wps_products WHERE status = '1' ANd customers_id='".$compContact['customers_id']."' AND website_category_id !=''")->num_rows();
                    if($serviceCount){
                ?>
                  <li class="cs-submenu"><a itemprop="url" href="<?php echo comp_url(); ?>service-listing" title="Our Products">Our Services <i class="fa fa-angle-down hidden-xs hidden-sm"></i></a> 
                    <ul class="cs-dropdown">
                      <?php
                      foreach ($catResService as $catVal) {
                        $catSub = $this->db->query("SELECT product_name, friendly_url FROM wps_products WHERE status = '1' AND website_category_id = '" . $catVal['category_id'] . "'")->result_array();
                        ?>
                        <li class="cs-submenu">
                          <a itemprop="name" href="<?php echo site_url() . $catVal['friendly_url']; ?>" title="<?php echo $catVal['category_name']; ?>"><?php echo $catVal['category_name']; ?> 
                            <?php
                            if (is_array($catSub) && !empty($catSub)) {
                              ?>
                              <i class="fa fa-angle-right hidden-xs hidden-sm"></i>
                              <?php
                            }
                            ?>
                          </a>
                          <?php
                          if (is_array($catSub) && !empty($catSub)) {
                            ?>
                            <ul class="cs-dropdown">
                              <?php
                              foreach ($catSub as $proVal) {
                                ?>
                                <li><a itemprop="url" href="<?php echo comp_url() . $proVal['friendly_url']; ?>" title="<?php echo $proVal['product_name']; ?>"><?php echo $proVal['product_name']; ?></a></li>
                                <?php
                              }
                              ?>
                            </ul>
                            <?php
                          }
                          ?>
                        </li>
                        <?php
                      }
                      ?>
                    </ul>
                  </li>
                  <?php 
                    }
                  }
                 } ?>

                <?php if(count($linkManagement)>0 && $linkManagement[0]['our_gallery']=='1' || empty($linkManagement)){ ?>
                  <li class="cs-submenu"><a itemprop="url" href="<?php echo comp_url(); ?>photo" title="Our Gallery">Our Gallery <i class="fa fa-angle-down hidden-xs hidden-sm"></i></a>
                    <ul class="cs-dropdown">
                      <?php if(count($linkManagement)>0 && $linkManagement[0]['photo_gallery']=='1' || empty($linkManagement)){ ?>
                      <li><a itemprop="url" href="<?php echo comp_url(); ?>photo" title="Photo Gallery">Photo Gallery</a></li>
                      <?php } ?>
                      <?php if(count($linkManagement)>0 && $linkManagement[0]['video_gallery']=='1' || empty($linkManagement)){ ?>
                      <li><a itemprop="url" href="<?php echo comp_url(); ?>video" title="Video Gallery">Video Gallery</a></li>
                      <?php } ?>
                    </ul>
                  </li>
                  <?php } ?>
                  <?php if(count($linkManagement)>0 && $linkManagement[0]['careers']=='1' || empty($linkManagement)){ ?>
                  <li><a itemprop="url" href="<?php echo comp_url(); ?>career" title="Careers">Careers</a></li>
                  <?php } ?>
                  <?php if(count($linkManagement)>0 && $linkManagement[0]['blogs']=='1' || empty($linkManagement)){ ?>
                  <li><a itemprop="url" href="<?php echo comp_url(); ?>blogs" title="Blogs">Blogs</a></li>
                  <?php } ?>
                  <?php if(count($linkManagement)>0 && $linkManagement[0]['contact_us']=='1' || empty($linkManagement)){ ?>
                  <li class="">
                    <a itemprop="url" href="<?php echo comp_url(); ?>contact-us" title="Contact Us">Contact Us</a>
                  </li>
                  <?php } ?>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </header>
<?php 
//} 
?>
<div class="clearfix"></div>