PATH:
home
/
lab2454c
/
isaaclondston.com
/
wp-content
/
themes
/
divine_saint
<?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; ?> <?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();?>
[+]
woocommerce
[-] footer-widget.php
[edit]
[-] search.php
[edit]
[-] index.php
[edit]
[-] page.php
[edit]
[-] searchform.php
[edit]
[+]
..
[-] sidebar.php
[edit]
[-] template-rough.php
[edit]
[-] rtl.css
[edit]
[-] woocommerce-new-old.php
[edit]
[-] blank-page-with-container.php
[edit]
[-] template-globalgem.php
[edit]
[-] single.php
[edit]
[-] footer.php
[edit]
[-] template-about.php
[edit]
[-] template-home.php
[edit]
[-] template-polished.php
[edit]
[-] .DS_Store
[edit]
[-] blank-page.php
[edit]
[-] left-sidebar.php
[edit]
[-] header.php
[edit]
[-] style.css
[edit]
[-] template-service.php
[edit]
[-] 404.php
[edit]
[-] readme.txt
[edit]
[-] single-attachment.php
[edit]
[-] screenshot.png
[edit]
[-] custom-editor-style.css
[edit]
[-] functions.php
[edit]
[-] archive.php
[edit]
[-] fullwidth.php
[edit]
[+]
template-parts
[-] comments.php
[edit]
[-] template-contact.php
[edit]
[+]
inc
[-] template-blog.php
[edit]
[-] woocommerce-old.php
[edit]