<?php
//echo phpinfo();
$catList = $this->db->query("SELECT category_name, friendly_url FROM wps_categories WHERE parent_id = '0' AND status = '1' AND catType='0' ORDER BY sort_order ASC")->result_array();
$catListServices = $this->db->query("SELECT category_name, friendly_url FROM wps_categories WHERE parent_id = '0' AND status = '1' AND catType='1' ORDER BY sort_order ASC")->result_array();
?>
<body>
  <!--PRE LOADING-->
  <!--<div id="preloader">
    <div id="status">&nbsp;</div>
  </div>-->
  <a id="scroll-up" title="Go to Top" ><i class="fa fa-angle-up"></i></a>
  <?php
  if ($this->router->fetch_class() == 'home' && ($this->router->fetch_method() == 'index' || $this->router->fetch_method() == 'homenew')) {
    ?>
    <!--BANNER AND SERACH BOX-->
    <section id="background" class="dir1-home-head">
      <div class="container">
        <div class="row">
          <div class="col-md-6 col-sm-6 col-xs-12 ">
            <div class="dir-ho-tl">
              <ul>
                <li>
                  <a href="<?php echo site_url(); ?>"><img src="<?php echo theme_url(); ?>images/logo.png" alt="<?php echo $this->config->item('site_name');?>" title="<?php echo $this->config->item('site_name');?>"> </a>
                </li>
              </ul>
            </div>
          </div>
          <div class="col-md-6 col-sm-6">
            <div class="dir-ho-tr">
              <ul>
                <?php
                if ($this->session->userdata("user_id") > 0) {
                  ?>
                  <li><a href="<?php echo site_url(); ?>members" title="My Account">My Account</a></li>
                  <li><a href="<?php echo site_url(); ?>logout" title="Logout">Logout</a></li>
                  <li><a href="<?php echo site_url(); ?>members/add-listing" title="List Your Business" class="v3-add-bus"><i class="fa fa-plus" aria-hidden="true"></i> List Your Business</a></li>
                  <?php
                } else {
                  ?>
                  <li><a href="<?php echo site_url(); ?>users/register" title="Register">Register</a> </li>
                  <!--
                  <li><a href="javascript:void(0);" title="Register" data-dismiss="modal" data-toggle="modal" data-target="#regis-ter">Register</a> </li>
                    <li><a href="<?php //echo site_url();        ?>login">Sign In</a> </li>-->
                  <?php /*<li><a href="javascript:void(0);" title="Sign In" class="loginLink" data-dismiss="modal" data-toggle="modal" data-target="#login-ter">Sign In</a> </li>
                  <li><a href="javascript:void(0);" data-dismiss="modal" data-toggle="modal" data-target="#regis-ter" title="List Your Business"><i class="fa fa-plus" aria-hidden="true"></i> List Your Business</a> </li> */ ?>
                  <?php
                }
                ?>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div class="container dir-ho-t-sp">
        <div class="">
          <div class="dir-hr1">
            <div class="dir-ho-t-tit">
              <!--<h1>Discover Your Next the right Service Experts</h1> -->
              <!--<h1 class="typing-wrap">
                A Natural Healthcare Platform
                <span class="typed-strings">
                  <span>to Get Verified Buyers & Sellers </span>
                  <span>to Get the Right Services</span>
                  <span>to Expand Your Business</span>
                </span>
                <span class="typed"></span>
              </h1>-->
              <h1>India's 1st Business Directory of Indian Farmers</h1>
            </div>
            <form name="searchForm" method="get" action="<?php echo site_url('search'); ?>" class="tourz-search-form">
              <div class="input-field">&nbsp;</div>
              <div class="input-field">               
                <input type="text" name="keyword" id="select-search" class="autocomplete search_keyword">
                <label for="select-search" class="search-hotel-type">Search Agro Product Producers (Enter Product Name & Search)</label>

                <div class="serach_listt"></div>
              </div>
              <div class="input-field">
                <input type="button" onclick="this.form.submit();" value="search" class="waves-effect waves-light tourz-sear-btn"> </div>
            </form>
            <h3 class="connect01">We Connect Buyers with Indian Farmers</h3>
            <ul class="connect02">
              <li><i class="fa fa-envelope"></i> Contact Indian Farmers</li>
              <li><i class="fa fa-gift"></i> Buy Wholesale Agro Products</li>
              <li><i class="fa fa-inr"></i> At Most Reasonable Price</li>
            </ul>
          </div>
        </div>
      </div>
    </section>
    <!--TOP SEARCH SECTION-->
    <?php
  }
  ?>
  <section <?php echo ($this->router->fetch_class() == 'home' && $this->router->fetch_method() == 'index') ? 'id="myID"' : ''; ?> class="<?php echo ($this->router->fetch_class() == 'home' && $this->router->fetch_method() == 'index') ? 'bottomMenu hom-top-menu' : 'bottomMenu dir-il-top-fix'; ?>">
    <div class="container top-search-main">
      <div class="row">
        <div class="ts-menu">
          <!--SECTION: LOGO-->
          <div class="ts-menu-1">
            <a class="hidden-xs" href="<?php echo site_url(); ?>"><img src="<?php echo theme_url(); ?>images/logo.png" alt="<?php echo $this->config->item('site_name');?>" title="<?php echo $this->config->item('site_name');?>"> </a>
            <a class="hidden-lg hidden-md hidden-sm mobile_logo" href="<?php echo site_url(); ?>"><img src="<?php echo theme_url(); ?>images/logo-m.png" alt="<?php echo $this->config->item('site_name');?>" title="<?php echo $this->config->item('site_name');?>"> </a>
          </div>
          <!--SECTION: BROWSE CATEGORY(NOTE:IT'S HIDE ON MOBILE & TABLET VIEW)-->
          <?php
          if (is_array($catList) && !empty($catList)) {
            ?>
            <div class="ts-menu-2"><a href="<?php echo site_url(); ?>directory" title="Directory" class="t-bb">All Categories <i class="fa fa-angle-down" aria-hidden="true"></i></a>
              <!--SECTION: BROWSE CATEGORY-->
              <div class="cat-menu cat-menu-1">
                <div class="dz-menu">
                  <div class="col-md-6">
                    <h2 class="mheading-nti">Services</h2>
                  <ul class="bdr-right">
                    <?php
                    foreach ($catListServices as $cat) {
                      ?>
                      <li><a href="<?php echo site_url() . $cat['friendly_url']; ?>" title="<?php echo $cat['category_name']; ?>"> <?php echo $cat['category_name']; ?> </a> </li>
                      <?php
                    }
                    ?>
                  </ul>
                </div>
                  <div class="col-md-6 ">
                      <h2 class="mheading-nti">Products</h2>
                  <ul class="bdr-right">
                    <?php
                    foreach ($catList as $cat) {
                      ?>
                      <li><a href="<?php echo site_url() . $cat['friendly_url']; ?>" title="<?php echo $cat['category_name']; ?>"> <?php echo $cat['category_name']; ?> </a> </li>
                      <?php
                    }
                    ?>
                  </ul>
                </div>

                  <a class="view_all_btn01 pull-right" href="<?php echo site_url(); ?>directory" title="View All Categories">View All Categories</a>
                </div>

                <div class="dir-home-nav-bot">
                  <ul>
                    <li>India’s 1st Specialised Marketplace For Natural Therapies, Health & Fitness Products <span><!--Call us on: +91 9911-244-888--></span> </li>
                    <li><a href="<?php echo site_url(); ?>packages" title="Advertise with us" class="waves-effect waves-light btn-large"><i class="fa fa-bullhorn"></i> Advertise with us</a>
                    </li>
                    <?php
                    if ($this->session->userdata('user_id') <= 0) {
                      ?>
                      <li><a href="javascript:void(0);" title="Add your business" class="waves-effect waves-light btn-large loginLink" data-dismiss="modal" data-toggle="modal" data-target="#regis-ter"><i class="fa fa-bookmark"></i> Add your business</a></li>
                      <?php
                    } else {
                      ?>
                      <li><a href="<?php echo site_url(); ?>members/add-product" title="Add your business" class="waves-effect waves-light btn-large"><i class="fa fa-bookmark"></i> Add your business</a></li>
                      <?php
                    }
                    ?>
                  </ul>
                </div>
              </div>
            </div>
            <?php
          }
          ?>
          <!--SECTION: SEARCH BOX-->
          <div class="ts-menu-3">
            <div class="">
              <form method="get" action="<?php echo site_url('search'); ?>" class="tourz-search-form tourz-top-search-form">
                <div class="input-field">
                </div>
                <div class="input-field">
                  <input type="text" name="keyword" id="top-select-search" class="search_keyword">
                  <label for="top-select-search" class="search-hotel-type">Search Service Provider...</label>
                  <div class="serach_listt"></div>
                </div>
                <div class="input-field">
                  <input type="button" onclick="this.form.submit();" value="" class="waves-effect-head"> </div>
              </form>
            </div>
          </div>
          <!--SECTION: REGISTER,SIGNIN AND ADD YOUR BUSINESS-->
          <div class="ts-menu-4">
            <div class="v3-top-ri">
              <ul>
                <li>
                  <?php
                  if ($this->session->userdata("user_id") > 0) {
                    ?>
                    <a href="<?php echo site_url(); ?>members" title="My Account" class="v3-menu-sign">My Account</a>
                    <a href="<?php echo site_url(); ?>logout" title="Logout" class="v3-menu-sign">Logout</a>
                    <a href="<?php echo site_url(); ?>members/add-listing" title="List Your Business" class="v3-add-bus"><i class="fa fa-plus" aria-hidden="true"></i> List Your Business</a>
                    <?php
                  } else {
                    ?>
                    <a href="<?php echo site_url(); ?>users/register" title="Register"  class="v3-menu-sign">Register</a>

                    <?php /*<a href="javascript:void(0);" title="Register" data-dismiss="modal" data-toggle="modal" data-target="#regis-ter" class="v3-menu-sign">Register</a>
                    <a href="javascript:void(0);" title="Sign In" class="v3-menu-sign loginLink" data-dismiss="modal" data-toggle="modal" data-target="#login-ter">Sign In</a>
                      <!--<a href="<?php //echo site_url();        ?>login" class="v3-menu-sign">Login</a>-->
                    <a href="javascript:void(0);" title="List Your Business" data-dismiss="modal" data-toggle="modal" data-target="#regis-ter"><i class="fa fa-plus" aria-hidden="true"></i> List Your Business</a>  
                    */ ?>                  
                    <?php
                  }
                  ?>

                </li>
              </ul>
            </div>
          </div>
          <!--MOBILE MENU ICON:IT'S ONLY SHOW ON MOBILE & TABLET VIEW-->
          <div class="ts-menu-5"><span><i class="fa fa-bars" aria-hidden="true"></i></span> </div>
          <!--MOBILE MENU CONTAINER:IT'S ONLY SHOW ON MOBILE & TABLET VIEW-->
          <div class="mob-right-nav" data-wow-duration="0.5s">
            <div class="mob-right-nav-close"><i class="fa fa-times" aria-hidden="true"></i> </div>
            <h5>Business</h5>
            <ul class="mob-menu-icon">
              <?php
              if ($this->session->userdata("user_id") > 0) {
                ?>
                <li><a href="<?php echo site_url(); ?>members/add-listing" title="Add Business" class="v3-add-bus"><i class="fa fa-plus" aria-hidden="true"></i> Add Business</a></li>
                <li><a href="<?php echo site_url(); ?>members" title="My Account">My Account</a></li>
                <li><a href="<?php echo site_url(); ?>logout" title="Logout">Logout</a></li>
                <?php
              } else {
                ?>
                <li><a href="javascript:void(0);" title="Add Business" data-dismiss="modal" data-toggle="modal" data-target="#regis-ter">Add Business</a> </li>
                <li><a href="javascript:void(0);" title="Register" data-dismiss="modal" data-toggle="modal" data-target="#regis-ter">Register</a> </li>
                <li><a href="javascript:void(0);" title="Sign In" data-toggle="modal" data-toggle="modal" data-target="#login-ter">Sign In</a> </li>
                <?php
              }
              ?>
            </ul>
            <?php
            if (is_array($catListServices) && !empty($catListServices)) {
              ?>
              <h5>Services</h5>
              <ul>
                <?php
                foreach ($catListServices as $cat) {
                  ?>
                  <li><a href="<?php echo site_url() . $cat['friendly_url']; ?>" title="<?php echo $cat['category_name']; ?>"><i class="fa fa-angle-right" aria-hidden="true"></i> <?php echo $cat['category_name']; ?></a> </li>

                  <?php
                }
                ?>
              </ul>
              <?php
            }
            ?>
              <?php
            if (is_array($catList) && !empty($catList)) {
              ?>
              <h5>Products</h5>
              <ul>
                <?php
                foreach ($catList as $cat) {
                  ?>
                  <li><a href="<?php echo site_url() . $cat['friendly_url']; ?>" title="<?php echo $cat['category_name']; ?>"><i class="fa fa-angle-right" aria-hidden="true"></i> <?php echo $cat['category_name']; ?></a> </li>

                  <?php
                }
                ?>
              </ul>
              <?php
            }
            ?>
          </div>
        </div>
      </div>
    </div>
  </section>
  <!--HOME PROJECTS-->