
<section class="margin-top-xs-55" style="background: #fff;position: relative;
">
	<div class="header-text mb-0">
		<div>
			<div class="row ">
				<div class="col-lg-12 col-md-12 col-sm-12 text-center">
					<svg style="width:100%;height: 450px;" viewBox="0 0 1280 679" preserveAspectRatio="none" width="100%" height="100%">
						<defs>   
							<g id="shape">
								<path d="M0 0H1280V544.882C1280 544.882 1115 679 640 679C165 679 0 544.882 0 544.882V0Z" fill="#D9D9D9"></path>
								<path d="M0 0H1280V544.882C1280 544.882 1115 679 640 679C165 679 0 544.882 0 544.882V0Z" fill="url(#gradient)"></path>
							</g>
							<radialGradient id="gradient" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(640 -261.197) rotate(90) scale(815.683 664.92)">
								<stop stop-color="#4169E1"></stop>
								<stop offset="1" stop-color="#071A34"></stop>
							</radialGradient>
						</defs>
						<use href="#shape"></use>
					</svg>
					<div class="frame-image">
						<div style="position: absolute; border-radius: inherit; inset: 0px;" data-framer-background-image-wrapper="true"><img decoding="async" sizes="100vw" src="<?php echo base_url(); ?>assets/lSHGuRrPALnsNPFyY1JslN8so.png" alt="" style="display: block; width: 100%; height: 100%; border-radius: inherit; object-position: center center; object-fit: cover;"></div>
					</div>
					<div class="text-body main-header-text">
					<h1 class="text-center text-white"><b><?php echo $heading->google_algorithm_heading; ?></b></h1>
                  <h4 class="text-center text-white"><?php echo $heading->google_algorithm_sub_heading; ?></h4>
					</div>
				</div>

				<div class="floating-icons">
					<i class="icon-facebook"></i>
					<i class="icon-adwords"></i>
					<i class="icon-seo"></i>
					<i class="icon-instagram"></i>
					<i class="icon-activecampaign"></i>
					<i class="icon-wordpress"></i>
					<i class="icon-shopify"></i>
					<i class="icon-youtube"></i>
					<i class="icon-analytics"></i>
					<i class="icon-kk"></i>
				</div>
			</div>
		</div>
	</div>
</section>


<section class=" mt-5 mb-0">
   <div class="container">
      <div class="card">
         <div class="item2-gl ">
            <div class="bg-white item2-gl-nav p-5">
               <div >
                  <label class="me-2 mt-3 mb-sm-1">Sort By:</label> 
                  <ul class="d-flex">
                     <li>
                        <?php $date_all = []; ?>
                        <?php foreach ($all_google_guide as $google)
                        {
                           $date_all[] = date('Y', strtotime($google->algorithm_date));
                        }
                        $all_date = array_unique($date_all)
                        ?>
                        <select onchange="filterSelection(this.value)" class="form-control w-100" >
                           <option value="">All Year</option>
                           <?php foreach ($all_date as $date):?>
                              <option value="<?php echo $date; ?>"><?php echo $date; ?></option>
                           <?php endforeach; ?>
                        </select>
                     </li>
                     <li class="ms-5">
                        <select onchange="filterSelection(this.value)" class="form-control w-100" >
                           <option value="">Any Status</option>
                           <option value="Unconfirmed">Unconfirmed</option>
                           <option value="Confirmed">Confirmed</option>
                        </select>
                     </li>
                     <li class="ms-5 pt-lg-3">
                        <a href="javascript:void(0)" onclick="filterSelection('all')">Reset Filters</a>
                     </li>
                  </ul>
               </div>
              
            </div>
         </div>
      </div>
   </div>
</section>
<?php 
$this->db->order_by('DATE(algorithm_date)', 'desc');
$this->db->select('algorithm_date');
$this->db->group_by('YEAR(algorithm_date)');
$all_algorithm = $this->db->get('google_algorithm_guide');
$data_main = array();
foreach ($all_algorithm->result() as $algorithm) 
{
   $this->db->where('YEAR(algorithm_date)', $algorithm->algorithm_date);
   $main_data = $this->db->get('google_algorithm_guide')->result();

   $algorithm->data = date('Y', strtotime($algorithm->algorithm_date));
   $algorithm->all_data = $main_data;
   
   array_push($data_main, $algorithm);
}
?>
<section class="faqs mt-0">
   <div class="container">
      <?php foreach ($data_main as $main_data):?>
         <h2><b class="filterDiv <?php echo $main_data->data; ?>"><?php echo $main_data->data; ?> Updates</b></h2>
         <?php foreach ($main_data->all_data as $google_guide):?>
            <div class="card filterDiv <?php if($google_guide->algorithm_status == 1):?>Confirmed<?php else:?>Unconfirmed<?php endif;?> <?php echo date('Y', strtotime($google_guide->algorithm_date)); ?>">
               <div class="card-header">
                  <h3 class="card-title d-inline-block"><?php echo $google_guide->algorithm_title ?> - <?php echo date('M d, Y', strtotime($google_guide->algorithm_date)); ?></h3>
                  <span class="ms-auto">
                     <?php if($google_guide->algorithm_status == 1):?>
                        <span class="badge badge-success">Confirmed</span>
                     <?php else:?>
                        <span class="badge badge-danger">Unconfirmed</span>
                     <?php endif;?>  
                  </span>
               </div>
               <div class="card-body">
                  <p class="mb-3"><?php echo $google_guide->algorithm_description ?></p>
                  <?php foreach (json_decode($google_guide->algorithm_link_text) as $key => $algorithm_link_text):?>
                     <ol class="breadcrumb1">
                        <li class="breadcrumb-item1 active"><a href="<?php echo json_decode($google_guide->algorithm_link_url)[$key] ?>" class=""><i class="fe fe-arrow-right me-2"></i><?php echo $algorithm_link_text ?></a></li>
                     </ol>
                  <?php endforeach; ?>
               </div>
            </div>
         <?php endforeach;?>
      <?php endforeach;?>
   </div>
</section>
<style type="text/css">
.fe-arrow-right {
  animation: blinker 3s linear infinite;
}

@keyframes blinker {
  50% {
    opacity: 0;
  }
}
.filterDiv
{
   display: none;
}
.show-div {
  display: block!important;
}
</style>
<script type="text/javascript">
$( document ).ready(function() {
   filterSelection("all");
});
function filterSelection(c) {
  var x, i;
  x = document.getElementsByClassName("filterDiv");
  if (c == "all") c = "";
  for (i = 0; i < x.length; i++) {
    w3RemoveClass(x[i], "show-div");
    if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show-div");
  }
}

function w3AddClass(element, name) {
  var i, arr1, arr2;
  arr1 = element.className.split(" ");
  arr2 = name.split(" ");
  for (i = 0; i < arr2.length; i++) {
    if (arr1.indexOf(arr2[i]) == -1) {element.className += " " + arr2[i];}
  }
}

function w3RemoveClass(element, name) {
  var i, arr1, arr2;
  arr1 = element.className.split(" ");
  arr2 = name.split(" ");
  for (i = 0; i < arr2.length; i++) {
    while (arr1.indexOf(arr2[i]) > -1) {
      arr1.splice(arr1.indexOf(arr2[i]), 1);     
    }
  }
  element.className = arr1.join(" ");
}

</script>