<?php  $uri = service('uri'); 
use App\Models\SettingModel;
use App\Models\BlogModel;
use App\Models\HomeModel;
use App\Models\MainpageModel;
$blog = new BlogModel();
$page_home = new HomeModel();
$main_page = new MainpageModel();
$all_page = $page_home->get_all_active_page();
$menu_name = $main_page->get_menu_name_setting_by_lan(session()->get('lan'));
?>

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="Anil z" name="author">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- SITE TITLE -->
<title><?php echo $title; ?></title>
<!-- Favicon Icon -->
<link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url(); ?><?php echo $app_setting->fevicon; ?>">
<?php
  if($uri->getSegment(1) == 'blog-category')
  {
     // echo '<title>'.$category->category_name.'</title>';
     // echo '<meta name="description" content="'.$category->description.'">';
     // echo '<meta name="keywords" content="'.$category->keywords.'">';
     // echo '<meta property="og:title" content="'.$category->category_name.'">';
     // echo '<meta property="og:type" content="website">';
     // echo '<meta property="og:url" content="'.base_url().'blog-category/'.$category->slug.'">';
     // echo '<meta property="og:description" content="'.$category->description.'">';
     // echo '<meta property="og:image" content="'.base_url().$category->image.'">';
  }
  elseif($uri->getSegment(1) == 'blog-details')
  {
     echo '<title>'.$blog->title.'</title>';
     echo '<meta name="description" content="'.$blog->short_description.'">';
     echo '<meta name="keywords" content="'.$blog->keywords.'">';
     echo '<title>'.$blog->title.'</title>';
     echo '<meta property="og:title" content="'.$blog->title.'">';
     echo '<meta property="og:type" content="article">';
     echo '<meta property="og:url" content="'.base_url().'blog-details/'.$blog->title_slug.'">';
     echo '<meta property="og:description" content="'.$blog->short_description.'">';
     echo '<meta property="og:image" content="'.base_url().$blog->image.'">';
  }
  elseif($uri->getSegment(1) == 'product')
  {
     echo '<title>'.$title.'</title>';
     echo '<meta name="description" content="'.strip_tags($product->prd_description).'">';
     // echo '<meta name="keywords" content="'.$product->keywords.'">';
     echo '<meta property="og:title" content="'.$product->prd_name.'">';
     echo '<meta property="og:type" content="og:product">';
     echo '<meta property="og:url" content="'.base_url().'product/'.$product->prd_slug.'">';
     echo '<meta property="og:description" content="'.strip_tags($product->prd_description).'">';
     echo '<meta property="og:image" content="'.base_url().$product->prd_default_image.'">';
  }
  else
  {
     echo '<title>'.$app_setting->application_name.'</title>';
     echo '<meta name="description" content="'.$app_setting->meta_description.'">';
     echo '<meta name="keywords" content="'.$app_setting->meta_keywords.'">';
     echo '<meta property="og:title" content="'.$app_setting->application_name.'">';
     echo '<meta property="og:type" content="website">';
     echo '<meta property="og:url" content="'.base_url().'">';
     echo '<meta property="og:description" content="'.$app_setting->meta_description.'">';
     echo '<meta property="og:image" content="'.base_url().$app_setting->header_logo.'">';
  }
    $setting = new SettingModel();
    $v_setting = $setting->get_visual_setting();
    $hex = $v_setting->color_1;
    list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
    $transparent_9 = 'rgba('.$r.','.$g.','.$b.', 0.9)';
    $transparent_8 = 'rgba('.$r.','.$g.','.$b.', 0.8)';
    $transparent_7 = 'rgba('.$r.','.$g.','.$b.', 0.7)';
    $transparent_6 = 'rgba('.$r.','.$g.','.$b.', 0.6)';
    $transparent_5 = 'rgba('.$r.','.$g.','.$b.', 0.4)';
    $transparent_4 = 'rgba('.$r.','.$g.','.$b.', 0.4)';
    $transparent_3 = 'rgba('.$r.','.$g.','.$b.', 0.3)';
    $transparent_2 = 'rgba('.$r.','.$g.','.$b.', 0.2)';
    $transparent_1 = 'rgba('.$r.','.$g.','.$b.', 0.1)';
    $transparent = 'rgba('.$r.','.$g.','.$b.', 0.75)';


?>
<script type="text/javascript">
     document.documentElement.style.setProperty('--theme-color-1', '<?php echo $v_setting->color_1 ?>');
     document.documentElement.style.setProperty('--theme-color-2', '<?php echo $v_setting->color_2 ?>');
     document.documentElement.style.setProperty('--theme-color-t-1', '<?php echo $transparent_1 ?>');
     document.documentElement.style.setProperty('--theme-color-t-2', '<?php echo $transparent_2 ?>');
     document.documentElement.style.setProperty('--theme-color-t-3', '<?php echo $transparent_3 ?>');
     document.documentElement.style.setProperty('--theme-color-t-4', '<?php echo $transparent_4 ?>');
     document.documentElement.style.setProperty('--theme-color-t-5', '<?php echo $transparent_5 ?>');
     document.documentElement.style.setProperty('--theme-color-t-6', '<?php echo $transparent_6 ?>');
     document.documentElement.style.setProperty('--theme-color-t-7', '<?php echo $transparent_7 ?>');
     document.documentElement.style.setProperty('--theme-color-t-8', '<?php echo $transparent_8 ?>');
     document.documentElement.style.setProperty('--theme-color-t-9', '<?php echo $transparent_9 ?>');
     document.documentElement.style.setProperty('--theme-color-t', '<?php echo $transparent ?>');
</script>

<link href="<?php echo base_url(); ?>/front_main/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url(); ?>/front_main/css/jquery-ui.min.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url(); ?>/front_main/css/animate.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url(); ?>/front_main/css/css-plugin-collections.css" rel="stylesheet"/>
<link id="menuzord-menu-skins" href="<?php echo base_url(); ?>/front_main/css/menuzord-skins/menuzord-boxed.css" rel="stylesheet"/>
<link href="<?php echo base_url(); ?>/front_main/css/style-main.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url(); ?>/front_main/css/preloader.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url(); ?>/front_main/css/custom-bootstrap-margin-padding.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url(); ?>/front_main/css/responsive.css" rel="stylesheet" type="text/css">

<link href="<?php echo base_url(); ?>/front_main/css/colors/theme-skin-blue-gary.css" rel="stylesheet" type="text/css">
<script src="<?php echo base_url(); ?>/front_main/js/jquery-2.2.0.min.js"></script>
<script src="<?php echo base_url(); ?>/front_main/js/jquery-ui.min.js"></script>
<script src="<?php echo base_url(); ?>/front_main/js/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>/front_main/js/jquery-plugin-collection.js"></script>

<?php if($uri->getSegment(1) == ''): ?>
<link  href="<?php echo base_url(); ?>/front_main/js/revolution-slider/css/settings.css" rel="stylesheet" type="text/css"/>
<link  href="<?php echo base_url(); ?>/front_main/js/revolution-slider/css/layers.css" rel="stylesheet" type="text/css"/>
<link  href="<?php echo base_url(); ?>/front_main/js/revolution-slider/css/navigation.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/jquery.themepunch.tools.min.js"></script>
<script src="<?php echo base_url(); ?>/front_main/js/revolution-slider/js/jquery.themepunch.revolution.min.js"></script>
<?php endif;?>


<link rel="stylesheet" href="<?php echo front_css() ?>sweetalert/sweetalert.min.css">
<script src="<?php echo front_css() ?>sweetalert/sweetalert.min.js"></script>

</head>
<body class="">
  <div class="preloader-ajax-bg" style="display:none"></div>
<div class="preloader-ajax" style="display:none"></div>

<div id="wrapper" class="clearfix">
  <!-- preloader -->
  <!-- <div id="preloader">
    <div id="spinner">
      <div class="preloader-dot-loading">
        <div class="cssload-loading"><i></i><i></i><i></i><i></i></div>
      </div>
    </div>
  </div> -->
  
  <!-- Header -->
  <header id="header" class="header">
    <div class="header-top bg-theme-colored-top-nav sm-text-center">
      <div class="container">
        <div class="row">
          <div class="col-md-8">
            <div class="widget no-border m-0">
              <ul class="list-inline sm-text-center mt-5">
                <li class="text-white">
                  <?php if(session()->get('lan') == 'en'):?>
                    Language : 
                  <?php else: ?>
                    भाषा
                  <?php endif; ?>
                </li>
                <li>
                  <select onchange="language_change(this.value)" class="form-control" style="padding-top: 0;height: 25px;padding-bottom: 0;">
                    <option <?php if(session()->get('lan') == 'en'){echo 'selected';}?> value="en">🇺🇸 English</option>
                    <option <?php if(session()->get('lan') == 'hi'){echo 'selected';}?> value="hi">🇮🇳 हिंदी</option>
                  </select>
                </li>
              </ul>
              <ul class="list-inline sm-text-center mt-5 hidden-lg">
                <li>
                  <a class="text-white" href="mailto:<?php echo $app_setting->email; ?>"><i class="fa fa-envelope" aria-hidden="true"></i> <?php echo $app_setting->email; ?></a>
                </li>
                
                <li>
                  <a class="text-white" href="tel:+91<?php echo $app_setting->mobile; ?>"><i class="fa fa-phone" aria-hidden="true"></i> +91-<?php echo $app_setting->mobile; ?></a>
                </li>
              </ul>
            </div>
          </div>
          <div class="col-md-4 hidden-xs">
            <div class="widget no-border m-0">
              <ul class="social-icons icon-dark icon-circled icon-theme-colored icon-sm pull-right flip sm-pull-none sm-text-center mt-sm-15">
                <?php if($app_setting->facebook):?>
                  <li><a class="facebook-head" href="<?php echo $app_setting->facebook; ?>"><i class="fa fa-facebook"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->twitter):?>
                  <li><a class="twitter-head" href="<?php echo $app_setting->twitter; ?>"><i class="fa fa-twitter"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->instagram):?>
                  <li><a class="instagram-head" href="<?php echo $app_setting->instagram; ?>"><i class="fa fa-instagram"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->whatsapp):?>
                  <li><a class="whatsapp-head" href="<?php echo $app_setting->whatsapp; ?>"><i class="fa fa-whatsapp"></i></a></li>
                <?php endif;?>
                <?php if($app_setting->linkdin):?>
                  <li><a class="linkedin-head" href="<?php echo $app_setting->linkdin; ?>"><i class="fa fa-linkedin"></i></a></li>
                <?php endif;?>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="header-middle p-0 bg-lightest xs-text-center">
      <div class="container pt-0 pb-0">
        <div class="row">
          <div class="col-xs-12 col-sm-4 col-md-8">
            <div class="widget no-border m-0">
              <a class="menuzord-brand pull-left flip xs-pull-center mb-15" href="<?php echo base_url(); ?>"><img defer data-src="<?php echo base_url(); ?><?php echo $app_setting->header_logo; ?>" alt="<?php echo $app_setting->application_name; ?>"></a>
            </div>
          </div>
          <div class="col-xs-12 col-sm-4 col-md-2 hidden-xs">
            <div class="widget no-border m-0">
              <div class="mt-40 mb-10 text-right flip sm-text-center">
                <div class="font-15 text-black-333 mb-5 font-weight-600"><i class="fa fa-envelope text-theme-colored font-18"></i> 
                  <?php if(session()->get('lan') == 'en'):?>
                    Mail Us Today 
                  <?php else: ?>
                    हमें मेल करें
                  <?php endif; ?>
                </div>
                <a class="font-12 text-gray" href="mailto:<?php echo $app_setting->email; ?>"> <?php echo $app_setting->email; ?></a>
              </div>
            </div>
          </div>
          <div class="col-xs-12 col-sm-4 col-md-2 hidden-xs">
            <div class="widget no-border m-0">
              <div class="mt-40 mb-10 text-right flip sm-text-center">
                <div class="font-15 text-black-333 mb-5 font-weight-600"><i class="fa fa-phone-square text-theme-colored font-18"></i> <?php echo $app_setting->mobile; ?></div>
                <a class="font-12 text-gray" href="tel:+91<?php echo $app_setting->mobile; ?>">
                <?php if(session()->get('lan') == 'en'):?>
                    Call us for more details!
                  <?php else: ?>
                    अधिक जानकारी के लिए कॉल करें!
                  <?php endif; ?></a>
              </div>
            </div>
          </div>
          
        </div>
      </div>
    </div>
    <div class="header-nav">
      <div class="header-nav-wrapper navbar-scrolltofixed bg-light">
        <div class="container">
          <nav id="menuzord" class="menuzord default bg-light">
            <ul class="menuzord-menu">
              <li <?php if($uri->getSegment(1) == ''){echo 'class="active"';}?>><a href="<?php echo base_url(); ?>"><?php echo $menu_name->menu_name_home; ?></a></li>
              <li <?php if($uri->getSegment(1) == 'about-us'){echo 'class="active"';}?>><a href="<?php echo base_url(); ?>/about-us"><?php echo $menu_name->menu_name_about_us; ?></a></li>
              <li <?php if($uri->getSegment(1) == 'projects'){echo 'class="active"';}?>><a href="<?php echo base_url(); ?>/projects"><?php echo $menu_name->menu_name_projects; ?></a></li>
              <!-- <li <?php if($uri->getSegment(1) == 'what-we-do'){echo 'class="active"';}?>><a href="<?php echo base_url(); ?>/what-we-do"><?php echo $menu_name->menu_name_what_we_do; ?></a></li> -->
              <li >
                <a href="#" <?php if($uri->getSegment(1) == 'member'){echo 'class="active"';}?>><?php echo $menu_name->member; ?></a>
                  <ul class="dropdown">
                      <li><a href="<?php echo base_url();?>/member/our-core-team"><?php echo $menu_name->our_core_team; ?></a></li>
                      <li><a href="<?php echo base_url();?>/member/our-founders"><?php echo $menu_name->our_founders; ?></a></li>
                  </ul>
              </li>
              <li >
                <a href="#" <?php if($uri->getSegment(1) == 'gallery'){echo 'class="active"';}?>><?php echo $menu_name->menu_name_gallery; ?></a>
                  <ul class="dropdown">
                      <li><a href="<?php echo base_url();?>/gallery/video"><?php echo $menu_name->menu_name_gallery_video; ?></a></li>
                      <li><a href="<?php echo base_url();?>/gallery/image"><?php echo $menu_name->menu_name_gallery_image; ?></a></li>
                  </ul>
              </li>
              
              
              <?php foreach ($all_page as $page):
                  if($page->important == 'Top'): ?>
                      <li><a href="<?php echo base_url(); ?>/p/<?php echo $page->slug; ?>"><?php echo $page->name; ?></a></li> 
                  <?php endif; 
              endforeach; ?>

              <li <?php if($uri->getSegment(1) == 'event' || $uri->getSegment(1) == 'event-details'){echo 'class="active"';}?>><a href="<?php echo base_url(); ?>/event"><?php echo $menu_name->menu_name_events; ?></a></li>
              <li <?php if($uri->getSegment(1) == 'media_corner'){echo 'class="active"';}?>><a href="<?php echo base_url(); ?>/media_corner"><?php echo $menu_name->menu_name_media_corner; ?></a></li>
              <li >
                <a href="#"><?php echo $menu_name->menu_name_blog; ?></a>
                  <ul class="dropdown">
                    <?php $all_b_cat = $blog->get_all_category(); 
                    foreach ($all_b_cat as $blog_cat):?>
                      <li><a href="<?php echo base_url();?>/blog-category/<?php echo $blog_cat->category_slug; ?>"><?php echo $blog_cat->category_name; ?></a></li>
                    <?php endforeach; ?>
                  </ul>
              </li>
              <li <?php if($uri->getSegment(1) == 'contact'){echo 'class="active"';}?>><a href="<?php echo base_url(); ?>/contact"><?php echo $menu_name->menu_name_contact; ?></a></li>
            </ul>
            <ul class="list-inline pull-right flip hidden-sm hidden-xs">
              <li>
                <a class="btn btn-colored btn-flat btn-theme-colored " style="margin-top: 7px" href="<?php echo base_url(); ?>/donate-now" ><?php echo donate_now(); ?></a>
              </li>
            </ul>
          </nav>
        </div>
      </div>
    </div>
  </header>

  <?php 
  $errors =  session()->get('error');
  if (isset($errors)) 
  {?>
    <script>
    swal ( "Oops" ,  "<?php echo $errors?>" ,  "error" )
  </script>
    <?php }
  session()->remove('error');
  $success =  session()->get('success');
  if (isset($success)) 
  {?>
    <script>
    swal ( "Done" ,  "<?php echo $success?>" ,  "success" )
  </script>
  <?php }
  session()->remove('success');
?>

<script type="text/javascript">
function language_change(e) 
{
   $.ajax({
          beforeSend: function() {
          $(".preloader-ajax").show();
          $(".preloader-ajax-bg").show();
      },
      type: "POST",
      url: "<?php echo base_url(); ?>/home/change_language",
      data: {
          e : e
      },
      success: function(data) 
      {
        location.reload();
      },
      error: function(xhr, textStatus) {
          console.log(xhr.responseText);
            alert(textStatus);
            $(".preloader-ajax").hide();
            $(".preloader-ajax-bg").hide();
      }
  });
}
</script>

<?php if(!session()->get('lan')):?>
<script type="text/javascript">
$( document ).ready(function() {
    $('#promoModal1').modal('show')
});
</script>
<div class="modal fade" id="promoModal1" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true" data-keyboard="false" data-backdrop="static">
   <div class="modal-dialog  modal-dialog-centered" role="document">
      <div class="modal-content vertical-align-center">
       <div class="modal-body">
          <div class="text-center">
            <img defer data-src="<?php echo base_url(); ?><?php echo $app_setting->header_logo; ?>" alt="<?php echo $app_setting->application_name; ?>" width="250px">
          </div>
          <div class="text-center mt-20">
            <h3>Please Choose your preferred language</h3>
            <h3 class="text-dark">कृपया अपनी पसंदीदा भाषा का चयन करें</h3>
          </div>
          <div class="text-center">
            <div class="wrapper">
             <input type="radio" name="select" id="option-1" onclick="language_change('en')">
             <input type="radio" name="select" id="option-2" onclick="language_change('hi')">
               <label for="option-1" class="option option-1">
                 <div class="dot"></div>
                  <span>English</span>
                  </label>
               <label for="option-2" class="option option-2">
                 <div class="dot"></div>
                  <span>Hindi</span>
               </label>
            </div>
          </div>
        </div>
      </div>
   </div>
</div>
<style type="text/css">
.modal-backdrop.in
{
  opacity: .95;
}
.wrapper{
  display: inline-flex;
  height: 100px;
  width: 400px;
  align-items: center;
  justify-content: space-evenly;
  border-radius: 5px;
  padding: 20px 15px;
}
.wrapper .option{
  background: #fff;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  margin: 0 10px;
  border-radius: 5px;
  cursor: pointer;
  padding: 0 10px;
  border: 2px solid lightgrey;
  transition: all 0.3s ease;
}
.wrapper .option .dot{
  height: 20px;
  width: 20px;
  background: #d9d9d9;
  border-radius: 50%;
  position: relative;
}
.wrapper .option .dot::before{
  position: absolute;
  content: "";
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  background: #0069d9;
  border-radius: 50%;
  opacity: 0;
  transform: scale(1.5);
  transition: all 0.3s ease;
}
input[type="radio"]{
  display: none;
}
#option-1:checked:checked ~ .option-1,
#option-2:checked:checked ~ .option-2{
  border-color: #0069d9;
  background: #0069d9;
}
#option-1:checked:checked ~ .option-1 .dot,
#option-2:checked:checked ~ .option-2 .dot{
  background: #fff;
}
#option-1:checked:checked ~ .option-1 .dot::before,
#option-2:checked:checked ~ .option-2 .dot::before{
  opacity: 1;
  transform: scale(1);
}
.wrapper .option span{
  font-size: 20px;
  color: #808080;
}
#option-1:checked:checked ~ .option-1 span,
#option-2:checked:checked ~ .option-2 span{
  color: #fff;
}
@media only screen and (max-width: 600px) {
  .wrapper{
    width: 100%!important;
  }
}
@media only screen and (min-width: 600px) {
.modal.in .modal-dialog {
    position: relative;
    top: 45%;
    transform: translateY(-45%);
}
}
</style>
<?php endif;?>