PATH:
home
/
lab2454c
/
isaaclondston.com
/
wp-content
/
themes
/
divine_saint
/
template-parts
<?php /** * Template Name: Services Page */ // For every Monday until 01/09/2022 $base_line = '2022-09-01'; $current_date = date('Y-m-d'); $array_all = $array_all_sector_unit = $marquee_urls = $urls = []; $date = date('Y-m-d'); $prev_date = date('Y-m-d', strtotime($date . ' -4 day')); while (strtotime($date) >= strtotime($prev_date)) { array_push($urls, 'https://api.kyotounit.com/?action=get_co2_sector_emissions_by_date&value=' . $date); $date = date("Y-m-d", strtotime("-1 day", strtotime($date))); } $data = !empty($urls) ? curlMultiUrls($urls) : []; if (!empty($data)) { $flag = 1; foreach ($data as $key => $value) { $results = json_decode($value); if (!empty($results)) { foreach ($results as $r_key => $r_value) { if ($flag > 1) { $array_all_sector_unit[$r_value->sector][] = $r_value; } } } $flag++; } } if(date('j', strtotime($current_date)) === '1'){ $last_monday = date('Y-m-d', strtotime($current_date . ' -7 day')); }else{ $last_monday = date('Y-m-d',strtotime("last Monday")); } //$previous_monday = date('Y-m-d', strtotime($last_monday . ' -7 day')); while (strtotime($last_monday) >= strtotime($base_line)) { array_push($marquee_urls, 'https://api.kyotounit.com/?action=get_co2_sector_emissions_by_date&value=' . $last_monday); $last_monday = date("Y-m-d", strtotime("-7 day", strtotime($last_monday))); } array_push($marquee_urls, 'https://api.kyotounit.com/?action=get_co2_sector_emissions_by_date&value=2022-09-01'); $marquee_data = !empty($marquee_urls) ? curlMultiUrls($marquee_urls) : []; if (!empty($marquee_data)) { $flag = 1; foreach ($marquee_data as $key => $value) { $results = json_decode($value); if (!empty($results)) { foreach ($results as $r_key => $r_value) { $array_all[$r_value->sector][] = $r_value; } } } } $html = ''; get_header();?> <div class="header__banner__main header__banner__inner"> <div class="header__banner___overlay"></div> <?php if (has_post_thumbnail()) {?> <div class="image__box"> <?php the_post_thumbnail();?> </div> <?php } ?> <div class="banner__content"> <div class="container"> <div class="banner__container__inner"> <h1><?php the_title();?></h1> </div> </div> </div> </div> <div class="container-fluid"> <div class="marquee"> <div class="marquee__content"> <?php $json_latest = file_get_contents('https://api.kyotounit.com/?action=get_co2_sector_emissions_latest'); $data_latest = json_decode($json_latest, true); if (!empty($data_latest)) { $html .= '<ul class="list-inline">'; foreach ($data_latest as $key => $value) { if (empty($array_all[$value['sector']])) continue; $html .= "<li>"; $html .= "<span class='sector'>" . $value['sector'] . "</span>"; $flag = 0; $kyoto_unit_base_value = $sector_unit_base_value = 0; $kyoto_unit_change = $sector_unit_change = false; $sector_unit_difference = 0; foreach ($array_all[$value['sector']] as $prev_key => $prev_val) { $flag++; if($flag == 1){ $kyoto_unit_base_value = $prev_val->kyoto_unit; //$sector_unit_base_value = $prev_val->sector_unit; $sector_unit_base_value = $value['sector_unit']; continue; } $kyoto_unit_difference = $kyoto_unit_base_value - $prev_val->kyoto_unit; //$sector_unit_difference = $sector_unit_base_value - $prev_val->sector_unit; if(isset($array_all_sector_unit[$value['sector']][$prev_key]->sector_unit) && ($flag <= 3)){ $sector_unit_difference = $sector_unit_base_value - $array_all_sector_unit[$value['sector']][$prev_key]->sector_unit; } if ($kyoto_unit_difference != 0 && !$kyoto_unit_change) { $kyoto_unit_change = true; $sticker = $kyoto_unit_difference > 0 ? 'up' : 'downgreen'; $html .= "<span class='kyoto__unit'>" . $value['kyoto_unit'] . "<img src='//isaaclondston.com/wp-content/uploads/2022/12/" . $sticker . ".png'></span>"; } if ($sector_unit_difference != 0 && !$sector_unit_change && $flag <= 3 ) { $sector_unit_change = true; $sticker = $sector_unit_difference > 0 ? 'up' : 'downgreen'; $html .= "<span class='sector__unit'>" . $value['sector_unit'] . "<img src='//isaaclondston.com/wp-content/uploads/2022/12/" . $sticker . ".png'></span>"; } if ($kyoto_unit_change && $sector_unit_change) break; } if (!$kyoto_unit_change) $html .= "<span class='kyoto__unit'>" . $value['kyoto_unit'] . "<img src='//isaaclondston.com/wp-content/uploads/2022/12/flat-line.png'></span>"; if (!$sector_unit_change) $html .= "<span class='kyoto__unit'>" . $value['sector_unit'] . "<img src='//isaaclondston.com/wp-content/uploads/2022/12/flat-line.png'></span>"; $html .= "</li>"; } } $html .= "</ul>"; echo $html; ?> </div> </div> </div> <div class="body__container__wrapp body__container__inner body__container__services"> <?php if (have_rows('why_carbon_bullion_section')) : while (have_rows('why_carbon_bullion_section')) : the_row(); ?> <div class="two__col__full__wrapp"> <div class="inner__content__wrap"> <div class="inner__content__holder"> <div class="container-xl"> <div class="row align-items-center"> <div class="col-xl-6 col-lg-6 col-md-6"> <?php the_sub_field('content'); ?> <div class="button__wrapp"> <a href="<?php the_sub_field('button_url'); ?>"> <?php the_sub_field('button_text'); ?> <svg xmlns="http://www.w3.org/2000/svg" width="30.243" height="13.501" viewBox="0 0 30.243 13.501"> <path id="Icon_ionic-ios-arrow-round-down" data-name="Icon ionic-ios-arrow-round-down" d="M24.49,20.784a.919.919,0,0,0-1.294-.007l-4.282,4.268V-1.218A.911.911,0,0,0,18-2.125a.911.911,0,0,0-.914.907V25.045L12.8,20.77a.925.925,0,0,0-1.294.007.91.91,0,0,0,.007,1.287l5.836,5.794h0a1.026,1.026,0,0,0,.288.19.872.872,0,0,0,.352.07.916.916,0,0,0,.64-.26l5.836-5.794A.9.9,0,0,0,24.49,20.784Z" transform="translate(2.125 24.748) rotate(-90)" /> </svg> </a> </div> </div> </div> </div> </div> <div class="image__box"> <img src="<?php the_sub_field('image'); ?>" alt="" /> </div> </div> </div> <?php endwhile; endif; ?> <!-- Product Section --> <div class="product__wrapp"> <div class="container-xl"> <?php if (have_rows('our_product_section')) : while (have_rows('our_product_section')) : the_row(); ?> <div class="heading__wrapp"> <h2><?php the_sub_field('heading'); ?></h2> <div class="header__wrapp__inner"> <i class="ico__box"><img src="<?php the_sub_field('line_image'); ?>" alt="" /></i> </div> </div> <div class="product__list__main"> <ul> <?php //global $products; $products = get_sub_field('our_products'); if( $products ): ?> <?php foreach( $products as $product): //setup_postdata($product); ?> <li class="product__item mr__bottom"> <div class="thumb__wrapper"> <a href="#"> <div class="image__box"> <?php if (has_post_thumbnail( $product->ID )) echo get_the_post_thumbnail($product->ID); else echo '<img src="'.woocommerce_placeholder_img_src($product->ID).'" alt="Placeholder" />'; ?> </div> </a> <?php $terms = get_the_terms( $product->ID, 'product_cat' ); if ( ! empty( $terms ) ) { foreach ( $terms as $term ) { ?> <span class="prod__cat__list"><?php echo $term->name; ?></span> <?php } } ?> <a href="<?php the_permalink($product->ID); ?>" class="loop__product__link"> <h3 class="product__title"><?php echo get_the_title($product->ID); ?></h3> <!-- <?php //$productstar = new wc_product( $product->ID ); /* get the WC_Product Object */ ?> <?php //if ($average = $productstar->get_average_rating()) : ?> <?php //echo '<div class="star-rating" title="'.sprintf(__( 'Rated %s out of 5', 'woocommerce' ), $average).'"><span style="width:'.( ( $average / 5 ) * 100 ) . '%"><strong itemprop="ratingValue" class="rating">'.$average.'</strong> '.__( 'out of 5', 'woocommerce' ).'</span></div>'; ?> --> <?php// endif; ?> <!-- <?php //$productprice = new wc_product( $product->ID ); /* get the WC_Product Object */ ?> <span class="price"><?php //echo wc_price($productprice->get_price_including_tax(1,$productprice->get_price())); ?></span> --> </a> </div> <div class="buttons__wrapper"> <a href="<?php echo get_home_url(); ?>/cart" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="button %s product_type_%s"><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 363.4 453.4" style="enable-background:new 0 0 363.4 453.4;" xml:space="preserve"> <path d="M352.1,453.4c-100.5,0-241,0-341.6,0c-0.1-0.8-0.7-0.9-1.3-1.2c-6.3-3-9.2-8-9.2-14.9c0-87.1,0-244.1,0-331.2 c0.1-9.8,6.3-16,16.2-16.1c13.3,0,46.7-0.2,60,0.1c3.6,0.1,4.7-1,5.2-4.5c9.4-61.6,74.7-101,133.3-79.8 c37.7,13.7,60.3,40.9,67.5,80.6c0.5,2.7,1.2,3.8,4.3,3.8c13.8-0.2,47.7-0.1,61.5-0.1c8.9,0,15.4,6.4,15.4,15.3 c0,87.6,0,245.1,0,332.7c0,3.3-1,6.3-2.8,9.1C358.5,450.3,355.1,451.5,352.1,453.4z M181.6,423.5c42.8,0,105.5,0,148.3,0 c2,0,3.6,0.4,3.6-2.8c-0.1-76-0.1-221.9,0-297.9c0-2.2-0.4-3-2.8-2.9c-8,0.2-36,0.2-43.9,0c-2.6-0.1-3.3,0.6-3.3,3.2 c0.2,13.5,0.1,26.9,0.1,40.4c0,9.5-6.1,16.2-14.8,16.3c-8.8,0.1-15.1-6.7-15.1-16.3c0-13.5-0.1-26.9,0.1-40.4c0-2.7-0.7-3.2-3.3-3.2 c-45.8,0.1-91.5,0.1-137.3,0c-2.7,0-3.3,0.7-3.2,3.3c0.1,13.5,0.1,26.9,0.1,40.4c0,9.5-6.2,16.2-14.8,16.3 c-8.8,0.1-15.1-6.7-15.1-16.4c0-13.2-0.1-26.4,0.1-39.7c0-2.9-0.4-4.1-3.7-3.9c-7.6,0.3-35.2,0.3-42.8,0c-3.1-0.1-3.5,1-3.5,3.7 c0.1,75.5,0.1,220.9,0,296.4c0,3,0.9,3.6,3.7,3.6C76.3,423.5,138.9,423.5,181.6,423.5z M252.2,89.9c-3.3-27.5-29.9-60.2-71.4-59.7 c-41,0.5-66.6,33.4-69.5,59.7C158.3,89.9,205.2,89.9,252.2,89.9z" /> </svg></a> <a href="<?php the_permalink($product->ID); ?>"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 357.4 172.2" style="enable-background:new 0 0 357.4 172.2;" xml:space="preserve"> <path d="M353.8,77.6c-0.1-0.1-0.1-0.1-0.2-0.1c0-0.1-0.1-0.1-0.1-0.2L279.8,3.6c-4.8-4.8-12.6-4.8-17.4,0c-4.8,4.8-4.8,12.6,0,17.4 l52.9,52.9h-303C5.5,73.8,0,79.3,0,86.1v0c0,6.8,5.5,12.3,12.3,12.3h303.3l-52.9,52.9c-4.8,4.8-4.8,12.6,0,17.4 c4.8,4.8,12.6,4.8,17.4,0l73.7-73.7C358.6,90.1,358.6,82.4,353.8,77.6z" /> </svg> </a> </div> </li> <?php endforeach; endif; //wp_reset_query(); ?> <?php endwhile; endif; ?> </ul> </div> <?php if (have_rows('our_product_section')) : while (have_rows('our_product_section')) : the_row(); if (get_sub_field('button_text')) { ?> <div class="button__wrapp"> <a href="<?php the_sub_field('button_url'); ?>"> <?php the_sub_field('button_text'); ?> <svg xmlns="http://www.w3.org/2000/svg" width="30.243" height="13.501" viewBox="0 0 30.243 13.501"> <path id="Icon_ionic-ios-arrow-round-down" data-name="Icon ionic-ios-arrow-round-down" d="M24.49,20.784a.919.919,0,0,0-1.294-.007l-4.282,4.268V-1.218A.911.911,0,0,0,18-2.125a.911.911,0,0,0-.914.907V25.045L12.8,20.77a.925.925,0,0,0-1.294.007.91.91,0,0,0,.007,1.287l5.836,5.794h0a1.026,1.026,0,0,0,.288.19.872.872,0,0,0,.352.07.916.916,0,0,0,.64-.26l5.836-5.794A.9.9,0,0,0,24.49,20.784Z" transform="translate(2.125 24.748) rotate(-90)"></path> </svg> </a> </div> <?php } endwhile; endif; ?> </div> </div> <?php if (have_rows('about_investment_section')) : while (have_rows('about_investment_section')) : the_row(); if (get_sub_field('heading')) { ?> <div class="full__width__bg" style="background-image: url('<?php the_sub_field('background_image'); ?>');"> <div class="inner__content__wrapp"> <div class="container-xl"> <div class="heading__wrapp"> <h2><?php the_sub_field('heading'); ?></h2> <div class="header__wrapp__inner"> <i class="ico__box"><img src="<?php the_sub_field('line_image'); ?>" alt="" /></i> </div> </div> <?php the_sub_field('content'); ?> <?php if (!empty(the_sub_field('button_url'))) { ?> <div class="button__wrapp"> <a href="<?php the_sub_field('button_url'); ?>"> <?php the_sub_field('button_text'); ?> <svg xmlns="http://www.w3.org/2000/svg" width="30.243" height="13.501" viewBox="0 0 30.243 13.501"> <path id="Icon_ionic-ios-arrow-round-down" data-name="Icon ionic-ios-arrow-round-down" d="M24.49,20.784a.919.919,0,0,0-1.294-.007l-4.282,4.268V-1.218A.911.911,0,0,0,18-2.125a.911.911,0,0,0-.914.907V25.045L12.8,20.77a.925.925,0,0,0-1.294.007.91.91,0,0,0,.007,1.287l5.836,5.794h0a1.026,1.026,0,0,0,.288.19.872.872,0,0,0,.352.07.916.916,0,0,0,.64-.26l5.836-5.794A.9.9,0,0,0,24.49,20.784Z" transform="translate(2.125 24.748) rotate(-90)"></path> </svg> </a> </div> <?php } ?> </div> </div> </div> <?php } endwhile; endif; ?> <?php if (have_rows('who_we_serve_section')) : while (have_rows('who_we_serve_section')) : the_row(); if (get_sub_field('content')) { ?> <div class="two__col__full__wrapp col__full__wrapp"> <div class="inner__content__wrap"> <div class="inner__content__holder"> <div class="container-xl"> <div class="row align-items-center"> <div class="col-xl-6 col-lg-6 col-md-6"> <?php the_sub_field('content'); ?> </div> </div> </div> </div> <div class="image__box"> <img src="<?php the_sub_field('image'); ?>" alt="" /> </div> </div> </div> <?php } endwhile; endif; ?> <?php if (have_rows('steps_carbon_bullion_listing_section')) : while (have_rows('steps_carbon_bullion_listing_section')) : the_row(); if (get_sub_field('title')) { ?> <div class="two__col__full__wrapp steps__wrapp"> <div class="container-xl"> <div class="heading__wrapp"> <h2><?php the_sub_field('title'); ?></h2> <div class="header__wrapp__inner"> <i class="ico__box"><img src="<?php the_sub_field('line_image'); ?>" alt="" /></i> </div> <h3><?php the_sub_field('sub_title'); ?></h3> </div> </div> <div class="inner__content__wrap"> <div class="inner__content__holder"> <div class="container-xl"> <div class="row align-items-center"> <div class="col-xl-8 col-lg-8 col-md-10 offset-xl-4 offset-lg-4 offset-md-2"> <div class="steps__list__main"> <div class="steps__items mr__top"> <?php if (have_rows('left_column_content')) : while (have_rows('left_column_content')) : the_row(); ?> <div class="item__wrapp"> <div class="step__item"> <div class="item__number"><?php echo get_sub_field('number'); ?></div> <div class="item__heading"> <h3><?php echo get_sub_field('heading'); ?></h3> </div> </div> <p><?php echo get_sub_field('content'); ?></p> </div> <?php endwhile; endif; ?> </div> <div class="steps__items mr__top"> <?php if (have_rows('right_column_content')) : while (have_rows('right_column_content')) : the_row(); ?> <div class="item__wrapp"> <div class="step__item"> <div class="item__number"><?php echo get_sub_field('number'); ?></div> <div class="item__heading"> <h3><?php echo get_sub_field('heading'); ?></h3> </div> </div> <p><?php echo get_sub_field('content'); ?></p> </div> <?php endwhile; endif; ?> </div> </div> </div> </div> </div> </div> <div class="image__box"> <img src="<?php the_sub_field('image'); ?>" alt="" /> </div> </div> </div> <?php } endwhile; endif; ?> <?php if (have_rows('ser_list_of_services')): while (have_rows('ser_list_of_services')): the_row(); ?> <?php if (have_rows('services_list')): while (have_rows('services_list')): the_row();?> <?php if (get_sub_field('service_title')) {?> <div class="container"> <div class="title__wrap"> <h2><?php echo get_sub_field('service_title'); ?></h2> </div> </div> <?php }?> <div class="full__width__wrap"> <div class="container-fluid"> <div class="row"> <?php if (get_sub_field('ser_left_column_content')) {?> <div class="col-xl-4 col-lg-4 p-0"> <div class="inner__content__wrap"> <div class="item__content"> <?php echo get_sub_field('ser_left_column_content'); ?> </div> </div> </div> <?php }?> <?php if (get_sub_field('ser_middle_column_content')) {?> <div class="col-xl-4 col-lg-4 p-0"> <div class="inner__content__wrap inner__content__wrap__middle"> <div class="item__content"> <?php echo get_sub_field('ser_middle_column_content'); ?> </div> </div> </div> <?php }?> <?php if (get_sub_field('ser_right_column_content')) {?> <div class="col-xl-4 col-lg-4 p-0"> <div class="inner__content__wrap inner__content__wrap__last"> <div class="item__content"> <?php echo get_sub_field('ser_right_column_content'); ?> </div> </div> </div> <?php }?> </div> </div> </div> <?php endwhile; endif; ?> <?php endwhile; endif; ?> <?php if (have_rows('ser_divine_investment_section')): while (have_rows('ser_divine_investment_section')): the_row(); ?> <div class="divine__saint__info diamond__investment"> <div class="content__wrap" style="background-image: url('<?php the_sub_field('background_image');?>'),url('<?php the_sub_field('background_image_2');?>');"> <div class="container"> <div class="row"> <div class="col-xl-6 col-lg-6"> <div class="content__wrap__innre"> <?php the_sub_field('content');?> </div> </div> </div> </div> </div> <div class="image__box"> <img src="<?php the_sub_field('image');?>" alt=""> </div> </div> <?php endwhile; endif; ?> </div> <?php get_footer();?>
[-] content-none.php
[edit]
[+]
..
[-] NewFile.php
[edit]
[-] content-search.php
[edit]
[-] content-page.php
[edit]
[-] content-notitle.php
[edit]
[-] content.php
[edit]