2021-01-09 11:13:06 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The template for displaying all single posts and attachments
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Twenty_Sixteen
|
|
|
|
* @since Twenty Sixteen 1.0
|
|
|
|
*/
|
|
|
|
get_header();
|
2018-03-21 18:19:20 +00:00
|
|
|
?>
|
|
|
|
<?php
|
2021-01-09 11:13:06 +00:00
|
|
|
function withinDates( $jSDate, $jEDate ) {
|
|
|
|
$endYear = date( 'Y' );
|
|
|
|
$endDate = $endYear . '-12-31';
|
|
|
|
$startDate = ( $endYear - 2 ) . '-01-01';
|
|
|
|
$jEDate = ( ! $jEDate ) ? date( 'Y-m-d' ) : ( ( $jEDate > $endDate ) ? $endDate : $jEDate );
|
|
|
|
return ( ( ( strtotime( $jSDate ) < strtotime( $endDate ) ) && ( strtotime( $jSDate ) > strtotime( $startDate ) ) ) && ( strtotime( $jEDate ) > strtotime( $startDate ) ) );
|
|
|
|
}
|
|
|
|
$args = array(
|
|
|
|
'post_type' => array(
|
|
|
|
'job',
|
|
|
|
),
|
|
|
|
'posts_per_page' => -1,
|
|
|
|
);
|
|
|
|
$loop = new WP_Query( $args );
|
|
|
|
?>
|
|
|
|
|
2018-03-21 18:19:20 +00:00
|
|
|
<header class="post-header-title">
|
2021-01-09 11:13:06 +00:00
|
|
|
<h1 id="page-title">Experience</h1>
|
|
|
|
<h2 id="page-subtitle">or, a brief history of Ben</h2>
|
|
|
|
<?php
|
|
|
|
while ( have_posts() ) :
|
|
|
|
the_post();
|
|
|
|
?>
|
|
|
|
<div class="entry-content tile" id="taxonomy-description">
|
2018-03-21 18:19:20 +00:00
|
|
|
<?php the_content(); ?>
|
2021-01-09 11:13:06 +00:00
|
|
|
</div>
|
2018-03-21 18:19:20 +00:00
|
|
|
<?php endwhile; ?>
|
|
|
|
</header>
|
|
|
|
<div id="primary" class="content-area">
|
2021-01-09 11:13:06 +00:00
|
|
|
<main id="company-main" class="site-main" role="main">
|
2018-03-21 18:19:20 +00:00
|
|
|
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
|
|
|
<script type="text/javascript">
|
2021-01-09 11:13:06 +00:00
|
|
|
jQuery(document).ready(function($) {
|
2018-03-21 18:19:20 +00:00
|
|
|
$('#timeline').height($(window).height() - $('.post-header-title').height() - 50);
|
2021-01-09 11:13:06 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
google.charts.load('current', {'packages':['timeline']});
|
|
|
|
google.charts.setOnLoadCallback(drawChart);
|
|
|
|
|
|
|
|
function drawChart() {
|
2018-03-21 18:19:20 +00:00
|
|
|
var container = document.getElementById('timeline');
|
|
|
|
var chart = new google.visualization.Timeline(container);
|
|
|
|
var dataTable = new google.visualization.DataTable();
|
|
|
|
|
|
|
|
dataTable.addColumn({ type: 'string', id: 'Type' });
|
|
|
|
dataTable.addColumn({ type: 'string', id: 'Role' });
|
|
|
|
dataTable.addColumn({ type: 'string', role: 'tooltip', 'p': {'html': true} });
|
|
|
|
dataTable.addColumn({ type: 'date', id: 'Start' });
|
|
|
|
dataTable.addColumn({ type: 'date', id: 'End' });
|
|
|
|
dataTable.addRows([
|
|
|
|
<?php
|
2021-01-09 11:13:06 +00:00
|
|
|
while ( $loop->have_posts() ) :
|
|
|
|
$loop->the_post();
|
|
|
|
?>
|
|
|
|
<?php
|
|
|
|
$isCurrent = ( get_post_meta( get_the_ID(), 'end-date', true ) ) ? false : true;
|
|
|
|
$company = wp_get_object_terms(
|
|
|
|
get_the_ID(),
|
|
|
|
'company',
|
|
|
|
array(
|
|
|
|
'fields' => 'names',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
$title = html_entity_decode( get_the_title() );
|
2018-03-21 18:19:20 +00:00
|
|
|
$start = get_the_date();
|
2021-01-09 11:13:06 +00:00
|
|
|
$end = ( ! get_post_meta( get_the_ID(), 'end-date', true ) ) ? date( 'D M d Y H:i:s O' ) : get_post_meta( get_the_ID(), 'end-date', true );
|
|
|
|
?>
|
|
|
|
[
|
|
|
|
'<?php echo ( $isCurrent ) ? 'Current' : 'Current'; ?>',
|
|
|
|
'<?php echo $title . ', ' . html_entity_decode( $company[0] ); ?>',
|
|
|
|
'<div style="padding: 20px"><h1><?php echo $title; ?></h1><h2><?php echo html_entity_decode( $company[0] ); ?></h2><ul><li><?php echo $start; ?>—<?php echo ( $isCurrent ) ? 'present' : $end; ?></li></ul></div>',
|
2018-03-21 18:19:20 +00:00
|
|
|
new Date('<?php echo $start; ?>'),
|
|
|
|
new Date('<?php echo $end; ?>')
|
2021-01-09 11:13:06 +00:00
|
|
|
],
|
2018-03-21 18:19:20 +00:00
|
|
|
<?php endwhile; ?>
|
|
|
|
]);
|
|
|
|
|
|
|
|
var options = {
|
2021-01-09 11:13:06 +00:00
|
|
|
tooltip: {isHtml: true},
|
|
|
|
timeline: {
|
2018-03-21 18:19:20 +00:00
|
|
|
showRowLabels: true,
|
2021-01-09 11:13:06 +00:00
|
|
|
},
|
2018-03-21 18:19:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
chart.draw(dataTable, options);
|
2021-01-09 11:13:06 +00:00
|
|
|
}
|
2018-03-21 18:19:20 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div id="slider-range"></div>
|
|
|
|
<div id="timeline"></div>
|
2021-01-09 11:13:06 +00:00
|
|
|
</main>
|
2018-03-21 18:19:20 +00:00
|
|
|
</div>
|
2021-01-09 11:13:06 +00:00
|
|
|
<?php // get_sidebar(); ?>
|
|
|
|
<?php get_footer(); ?>
|