ldc-groupe/content/themes/ldc/page-finance.php
Vincent BRIDIER b567357140 - Point 29
2020-08-21 16:00:33 +02:00

493 lines
24 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
Template Name: Page Finance
*/
?>
<?php get_header(); ?>
<?php
global $tp;
$engagements = get_field('finance_engagements');
$price = get_field('finance_price');
$shareholders = get_field('shareholders');
$shareholder_rights = get_field('shareholder_rights');
$investor_presentation = get_field('investor_presentation');
$key_figures_and_results = get_field('key_figures_and_results');
$dividend_history = get_field('dividend_history');
$publications = get_field('publications_et_informations');
$general_meetings = get_field('general_meetings');
?>
<div class="page-finance">
<?php get_template_part('partials/hero'); ?>
<?php get_template_part('partials/breadcrumbs'); ?>
<div id="finance_1">
<?php get_template_part('partials/engagements'); ?>
</div>
<?php if(!empty($price)) : ?>
<div id="cours_de_bourse_ldc">
<div class="finance-price fw fw-container gray-bg">
<div class="finance-price__wrapper wrapper">
<?php if(!empty($price['title']) || !empty($price['subtitle']['text'])) : ?>
<h2 class="finance-price__title textblock__title title">
<?php if(!empty($price['title'])) : ?>
<span class="title-text"><?php echo $price['title']; ?></span>
<?php endif; ?>
<?php if(!empty($price['subtitle'])) : ?>
<span class="finance-price__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint"><?php echo $price['subtitle']; ?></span>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php if(!empty($price['text'])) : ?>
<div class="finance-price__text description"><?php echo $price['text']; ?></div>
<?php endif; ?>
<div class="finance-price__api finance-api">
<?php if(!empty($price['stock_prices'])) : ?>
<?php $stock = $price['stock_prices']; ?>
<div class="finance-api__block">
<h3 class="finance-api__title subtitle"><?php echo $stock['title']; ?></h3>
<?php get_template_part('partials/finance-api'); ?>
<div class="finance-api__text description"><?php echo $stock['text']; ?></div>
<div class="finance-api__btns">
<?php foreach($stock['buttons'] as $b) : ?>
<a class="finance-api__btn btn" href="<?php echo $b['file']; ?>" title="<?php echo $b['text']; ?>" download><?php echo $b['text']; ?> <i class="btn__icon btn__icon_dl"></i></a>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if(!empty($price['calendar_of_publications'])) : ?>
<?php $calendar = $price['calendar_of_publications']; ?>
<div class="finance-api__block finance-api__block_calendar">
<h3 class="finance-api__title subtitle"><?php echo $calendar['title']; ?></h3>
<?php if(!empty($calendar['list'])) : ?>
<div class="accordeon__list">
<?php $active = 'active'; ?>
<?php foreach($calendar['list'] as $cl) : ?>
<div class="accordeon__item accordeon-item">
<div class="accordeon-item__title"><?php echo $cl['title'] ?></div>
<div class="accordeon-item__info <?php echo $active ?>">
<div class="accordeon-item__info-inner">
<?php if(!empty($cl['content'])) : ?>
<?php foreach($cl['content'] as $cc) : ?>
<div class="accordeon-item__text-wrap">
<div class="accordeon-item__date date"><?php echo $cc['date'] ?></div>
<div class="accordeon-item__text"><?php echo $cc['text'] ?></div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
<?php $active = NULL; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php if(!empty($price['description'])) : ?>
<div class="finance-price__description description"><?php echo $price['description']; ?></div>
<?php endif; ?>
<?php if(!empty($price['button'])) : ?>
<div class="finance-price__btn-wrap">
<a class="finance-price__btn btn" href="<?php echo $price['button']['url']; ?>" title="<?php echo $price['button']['title']; ?>"><?php echo $price['button']['title']; ?> <i class="btn__icon btn__icon_eye"></i></a>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php if(!empty($shareholders)) : ?>
<div id="finance_3">
<div class="finance-shareholders fw fw-container no-bottom-padding">
<div class="finance-shareholders__wrapper wrapper">
<?php if(!empty($shareholders['title']) || !empty($shareholders['subtitle']['text'])) : ?>
<h2 class="finance-shareholders__title textblock__title title">
<?php if(!empty($shareholders['title'])) : ?>
<span class="title-text"><?php echo $shareholders['title']; ?></span>
<?php endif; ?>
<?php if(!empty($shareholders['subtitle'])) : ?>
<span class="finance-shareholders__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint"><?php echo $shareholders['subtitle']; ?></span>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php if(!empty($shareholders['text'])) : ?>
<div class="inance-shareholders__text description"><?php echo $shareholders['text']; ?></div>
<?php endif; ?>
<?php if(!empty($shareholders['blocks'])) : ?>
<div class="finance-shareholders__blocks textblock__container">
<?php foreach($shareholders['blocks'] as $b) : ?>
<div class="finance-shareholders__block textblock__block">
<?php if(!empty($b['title'])) : ?>
<h3 class="finance-shareholders__block-title subtitle"><?php echo $b['title']; ?></h3>
<?php endif; ?>
<?php if(!empty($b['content'])) : ?>
<div class="finance-shareholders__block-text description"><?php echo $b['content']; ?></div>
<?php endif; ?>
<?php if(!empty($b['button']['url'])) : ?>
<a class="finance-shareholders__block-btn btn" href="<?php echo $b['button']['url']; ?>" title="<?php echo $b['button']['title']; ?>"><?php echo $b['button']['title']; ?> <i class="btn__icon btn__icon_arrow-right"></i></a>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if(!empty($shareholders['text_block'])) : ?>
<div class="finance-shareholders__textblock textblock__container">
<?php
set_query_var('text_block_list', $shareholders['text_block']['list']);
get_template_part('partials/text-block-list');
?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php if(!empty($shareholder_rights)) : ?>
<div class="finance-shareholder-rights">
<?php
set_query_var('text_block', $shareholder_rights['text_block']);
get_template_part('partials/text-block');
?>
<?php if(!empty($shareholder_rights['blocks'])) : ?>
<div class="finance-shareholder-rights__wrapper wrapper">
<div class="finance-shareholder-rights__blocks textblock__container">
<?php foreach($shareholder_rights['blocks'] as $b) : ?>
<div class="finance-shareholder-rights__block textblock__block">
<?php if(!empty($b['title'])) : ?>
<h3 class="finance-shareholder-rights__block-title subtitle"><?php echo $b['title']; ?></h3>
<?php endif; ?>
<?php if(!empty($b['text'])) : ?>
<div class="finance-shareholder-rights__block-text description"><?php echo $b['text']; ?></div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php
set_query_var('documents', $shareholder_rights['documents']);
set_query_var('documents_icon', 'btn__icon_dl');
if($mob) {
get_template_part('partials/documents', 'mobile');
} else {
get_template_part('partials/documents');
}
?>
</div>
<?php endif; ?>
<?php if(!empty($investor_presentation)) : ?>
<div id="finance_4">
<div class="presentation gray-bg">
<?php
set_query_var('text_block', $investor_presentation['text_block']);
get_template_part('partials/text-block');
?>
<?php
$category = 'presentation';
$cat_obj = get_category_by_slug($category);
$template = 'list-item-presentation';
$years = get_posts_years_array($cat_obj);
?>
<div class="posts filter-posts">
<div class="filter filter_presentation fw" data-posts="#$category" data-list="list-item-presentation">
<div class="filter__wrapper wrapper">
<div class="filter-menu">
<div class="filter__select-wrap filter-select-wrap">
<ul class="filter-select">
<li>
<a title="Afficher">Afficher</a>
<ul>
<li><a class="tax-filter parida-filter" data-order="ASC" data-category="<?php echo $category ?>" title="Du plus ancien au plus récent">Du plus ancien au plus récent</a></li>
<li><a class="tax-filter parida-filter" data-order="DESC" data-category="<?php echo $category ?>" title="Du plus récent au plus ancien">Du plus récent au plus ancien</a></li>
</ul>
</li>
</ul>
<ul class="filter-select">
<li>
<a title="Exercice">Exercice</a>
<?php filter_years_html($years, $category) ?>
</li>
</ul>
<div class="filter-results-num">
Résultat : <span class="filter-results-num__wrap"><span class="filter-results-num__current">0</span> documents sur <span class="filter-results-num__total">0</span></span>
</div>
</div>
</div>
<div class="active-filters">
<div class="active-filters__list"></div>
<div class="active-filters__clear-wrap">
<div class="active-filters__item active-filters__item_clear"><a class="active-filters__item-remove clear-all" data-category="<?php echo $category ?>" title="Effacer les filtres">&#10006;</a> Effacer les filtres</div>
</div>
</div>
</div>
</div>
<div class="posts-list fw fw-container no-top-padding">
<div class="posts-list__wrapper wrapper">
<div class="posts-container">
<div class="list-items posts-container" id="posts-container">
<div class="list-items list-items_presentation">
<?php echo do_shortcode('[ajax_load_more id="finance_4" theme_repeater="'.$template.'" category="'.$category.'" loading_style="infinite fading-circles" post_type="post" posts_per_page="3" max_pages="1" scroll="true" button_label="Voir plus d’actualités" nester="true"]') ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div id="finance_5"></div>
<?php if(!empty($key_figures_and_results)) : ?>
<div class="kfar">
<?php
set_query_var('text_block', $key_figures_and_results['text_block']);
get_template_part('partials/text-block');
?>
<?php if(!empty($key_figures_and_results['blocks'])) : ?>
<div class="kfar-blocks fw">
<div class="kfar__wrapper wrapper">
<div class="kfar__list">
<?php foreach($key_figures_and_results['blocks'] as $b) : ?>
<div class="kfar-item">
<div class="kfar-item__title subtitle"><?php echo $b['title'] ?></div>
<div class="kfar-item__text description"><?php echo $b['text'] ?></div>
<a class="kfar-item__image" href="<?php echo $b['image'] ?>" title="<?php echo $b['title'] ?>" data-fancybox><img src="<?php echo $b['image'] ?>" alt="<?php echo $b['title'] ?>" /></a>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if(!empty($dividend_history)) : ?>
<div class="dividend-history fw fw-container">
<div class="dividend-history__wrapper wrapper">
<?php if(!empty($dividend_history['title'])) : ?>
<h3 class="dividend-history__title subtitle"><?php echo $dividend_history['title']; ?></h3>
<?php endif; ?>
<table class="dividend-history__table">
<?php foreach ($dividend_history['fields'] as $f) : ?>
<tr class="dividend-history__tr">
<td class="dividend-history__td dividend-history__td_title"><?php echo $f['title'] ?></td>
<?php foreach ($f['nums'] as $n): ?>
<td class="dividend-history__td"><?php echo $n['text']; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
<table class="dividend-history__table-mobile">
<?php
// var_dump('<pre>', $dividend_history['fields'] ,'</pre>'); die;
$title_nums = array();
?>
<?php foreach ($dividend_history['fields'] as $k => $f) : ?>
<?php if ($k == 0) : ?>
<tr class="dividend-history__tr dividend-history__tr_title">
<td class="dividend-history__td dividend-history__td_title black_td" colspan="2"><?php echo $f['title'] ?></td>
</tr>
<?php
$title_nums = $f['nums'];
?>
<?php else : ?>
<tr class="dividend-history__tr dividend-history__tr_title">
<td class="dividend-history__td dividend-history__td_title red_td" colspan="2"><?php echo $f['title'] ?></td>
</tr>
<?php foreach ($f['nums'] as $kk => $n) : ?>
<tr class="dividend-history__tr">
<td class="dividend-history__td"><?php echo $title_nums[$kk]['text']; ?></td>
<td class="dividend-history__td"><?php echo $n['text']; ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
</table>
<p style="margin-top: 10px;"><?= $dividend_history['legende']; ?></p>
</div>
</div>
<?php endif; ?>
<div id="finance_6">
<div class="publications fw fw-container gray-bg">
<!-- <div class="publications__wrapper wrapper">
<h2 class="publications__title textblock__title title">
<span class="title-text">Publications et informations</span>
<span class="publications__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint">Réglementées</span>
</h2>
</div> -->
<?php
set_query_var('addclass', 'no-top-padding no-bottom-padding');
set_query_var('text_block', $publications['text_block']);
get_template_part('partials/text-block');
?>
<?php
$category = 'documents';
$cat_obj = get_category_by_slug($category);
$template = 'list-item-doc';
$years = get_posts_years_array($cat_obj);
?>
<div class="posts filter-posts">
<div class="filter filter_doc fw" data-posts="#$category" data-list="list-item-doc">
<div class="filter__wrapper wrapper">
<div class="filter-menu">
<div class="filter__select-wrap filter-select-wrap">
<ul class="filter-select">
<li>
<a title="Afficher">Afficher</a>
<ul>
<li><a class="tax-filter parida-filter" data-order="ASC" data-category="<?php echo $category ?>" title="Du plus ancien au plus récent.">Du plus ancien au plus récent.</a></li>
<li><a class="tax-filter parida-filter" data-order="DESC" data-category="<?php echo $category ?>" title="Du plus récent au plus ancien.">Du plus récent au plus ancien.</a></li>
</ul>
</li>
</ul>
<ul class="filter-select">
<li>
<a title="Document">Document</a>
<?php tags_filter($category) ?>
</li>
</ul>
<ul class="filter-select">
<li>
<a title="Exercice">Exercice</a>
<?php filter_years_html($years, $category) ?>
</li>
</ul>
<div class="filter-results-num">
Résultat : <span class="filter-results-num__wrap"><span class="filter-results-num__current">0</span> documents sur <span class="filter-results-num__total">0</span></span>
</div>
</div>
</div>
<div class="active-filters">
<div class="active-filters__list"></div>
<div class="active-filters__clear-wrap">
<div class="active-filters__item active-filters__item_clear"><a class="active-filters__item-remove clear-all" data-category="<?php echo $category ?>" title="Effacer les filtres">&#10006;</a> Effacer les filtres</div>
</div>
</div>
</div>
</div>
<div class="posts-list fw">
<div class="posts-list__wrapper wrapper">
<div class="posts-container">
<div class="list-items list-items_doc">
<?php echo do_shortcode('[ajax_load_more id="finance_6" theme_repeater="'.$template.'" category="'.$category.'" loading_style="infinite fading-circles" post_type="post" posts_per_page="3" max_pages="1" scroll="true" button_label="Voir plus d’actualités" nester="true"]') ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="finance_7"></div>
<?php if(!empty($general_meetings)) : ?>
<?php
set_query_var('addclass', 'half-bottom-padding');
set_query_var('text_block', $general_meetings['text_block']);
set_query_var('custom_class', 'assemblees-generales');
get_template_part('partials/text-block');
?>
<?php endif; ?>
<?php
$category = 'meetings';
$cat_obj = get_category_by_slug($category);
$template = 'list-item-doc';
$years = get_posts_years_array($cat_obj);
?>
<div class="posts filter-posts">
<div class="filter filter_doc fw" data-posts="#$category" data-list="list-item-doc">
<div class="filter__wrapper wrapper">
<div class="filter-menu">
<div class="filter__select-wrap filter-select-wrap">
<ul class="filter-select">
<li>
<a title="Afficher">Afficher</a>
<ul>
<li><a class="tax-filter parida-filter" data-order="ASC" data-category="<?php echo $category ?>" title="Du plus ancien au plus récent.">Du plus ancien au plus récent.</a></li>
<li><a class="tax-filter parida-filter" data-order="DESC" data-category="<?php echo $category ?>" title="Du plus récent au plus ancien.">Du plus récent au plus ancien.</a></li>
</ul>
</li>
</ul>
<ul class="filter-select">
<li>
<a title="Document">Document</a>
<?php tags_filter($category) ?>
</li>
</ul>
<ul class="filter-select">
<li>
<a title="Exercice">Exercice</a>
<?php filter_years_html($years, $category) ?>
</li>
</ul>
<div class="filter-results-num">
Résultat : <span class="filter-results-num__wrap"><span class="filter-results-num__current">0</span> documents sur <span class="filter-results-num__total">0</span></span>
</div>
</div>
</div>
<div class="active-filters">
<div class="active-filters__list"></div>
<div class="active-filters__clear-wrap">
<div class="active-filters__item active-filters__item_clear"><a class="active-filters__item-remove clear-all" data-category="<?php echo $category ?>" title="Effacer les filtres">&#10006;</a> Effacer les filtres</div>
</div>
</div>
</div>
</div>
<div class="posts-list finance-page-posts-list fw fw-container no-top-padding">
<div class="posts-list__wrapper wrapper">
<div class="posts-container">
<div class="list-items list-items_doc">
<?php echo do_shortcode('[ajax_load_more id="finance_7" theme_repeater="'.$template.'" category="'.$category.'" loading_style="infinite fading-circles" post_type="post" posts_per_page="3" max_pages="1" scroll="true" button_label="Voir plus d’actualités" nester="true"]') ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>