<?php $repeater = get_field('plaats_en_data'); 
$order = array();

// populate order
foreach( $repeater as $i => $row ) {
	$vandaag = strtotime(date('Ymd'));
	$str_datum = strtotime($row['start_datum']);
	
	$plaats[ $i ] = $row['plaats'];
	
	if ($str_datum >= $vandaag):
	$datum[ $i ] = strtotime($row['start_datum']);
	endif;
}
array_multisort( $plaats, $datum, SORT_ASC, $repeater );
?>
<div class="container-fluid">
	<div class="container">
		<div class="row">
			<div class="col-xs-12 col-sm-12 col-md-8" id="main">	
				<div class="hidden-md hidden-lg "><a class="ovrzcht" href="javascript:history.back()">Terug naar overzicht</a><br/><br/></div>
				<?php if (have_posts()): while (have_posts()) : the_post(); ?>
					<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
						<?php $locs = get_the_terms( get_the_ID(), 'leervormen' );
									if ( $locs && ! is_wp_error( $locs ) ) : ?>
									<?php 
									    $gekoppelde_locaties = array();
									    $gekoppelde_locatiesslug = array();
									    foreach ( $locs as $loc ) {
									        $gekoppelde_locaties[] = $loc->name;
									        $gekoppelde_locatiesslug[] = $loc->slug;
									    }                   
									    $spangekoppelde_locaties = join( ", ", $gekoppelde_locaties );
									    $gekoppelde_locatiesslug = join( ", ", $gekoppelde_locatiesslug ); ?>
									<?php endif; ?>
						<h1><?php the_title();?> <?php/*(<?php echo $spangekoppelde_locaties; ?>)*/?></h1>
						<?php the_content(); ?>	
					</article>	
				<?php endwhile; ?>
				<?php else: ?>
					<article>
						<h2><?php _e( 'Sorry, er is niets om te laten zien.', 'html5blank' ); ?></h2>
					</article>				
				<?php endif; ?>
				<ul class="nav nav-tabs" id="trngtbs" role="tablist">
				  <li class="nav-item">
				    <a class="nav-link active" id="omschrijving-tab" data-toggle="tab" href="#omschrijving" role="tab" aria-controls="home" aria-selected="true">Omschrijving</a>
				  </li>
				  <li class="nav-item">
				    <a class="nav-link" id="inhoud-tab" data-toggle="tab" href="#inhoud" role="tab" aria-controls="inhoud" aria-selected="false">Inhoud</a>
				  </li>
				  <?php if( has_term( 'elearning', 'leervormen', get_the_ID() ) || has_term( 'in-company', 'leervormen', get_the_ID() )) { } else {?>
				  <li class="nav-item">
				    <a class="nav-link" id="data-tab" data-toggle="tab" href="#data" role="tab" aria-controls="data" aria-selected="false">Plaats en data <?php if($repeater && $datum):?>(<?php echo count($datum); ?>)<?php endif; ?></a>
				  </li>
				  <?php };?>
				</ul>
				<div class="tab-content" id="trngtbscntnt">
				  <div class="tab-pane fade show active" id="omschrijving" role="tabpanel" aria-labelledby="omschrijving-tab">
					  <?php the_field('omschrijving');?>
					  <div id="inf">
						  <?php if(get_field('doelgroep')):?>
						  <div class="row doelgroep">
							  <div class="col-xs-2 col-sm-2 col-md-1 pdngrghnul">
							  	<?php echo file_get_contents(get_template_directory_uri()."/assets/img/doelgroep.svg"); ?>
							  </div>
							  <div class="col-xs-10 col-sm-10 col-md-11">
								  <span class="ttle">Doelgroep</span>
								  <p><?php the_field('doelgroep');?></p>
							  </div>
						  </div>
						  <?php endif; ?>
						  <?php if(get_field('voorkennis')):?>
						  <div class="row voorkennis">
							  <div class="col-xs-2 col-sm-2 col-md-1 pdngrghnul">
							  	<?php echo file_get_contents(get_template_directory_uri()."/assets/img/voorkennis.svg"); ?>
							  </div>
							  <div class="col-xs-10 col-sm-10 col-md-11">
								  <span class="ttle">Voorkennis</span>
								  <p><?php the_field('voorkennis');?></p>
							  </div>
						  </div>
						  <?php endif; ?>
						  <?php if(get_field('duur')):?>
						   <div class="row duur">
							  <div class="col-xs-2 col-sm-2 col-md-1 pdngrghnul">
							  	<?php echo file_get_contents(get_template_directory_uri()."/assets/img/duur.svg"); ?>
							  </div>
							  <div class="col-xs-10 col-sm-10 col-md-11">
								  <span class="ttle">Duur</span>
								  <p><?php the_field('duur');?></p>
							  </div>
						  </div>
						  <?php endif; ?>
						  <?php if(get_field('groepsgrootte')):?>
						   <div class="row groepsgrootte">
							  <div class="col-xs-2 col-sm-2 col-md-1 pdngrghnul">
							  	<?php echo file_get_contents(get_template_directory_uri()."/assets/img/groepsgrootte.svg"); ?>
							  </div>
							  <div class="col-xs-10 col-sm-10 col-md-11">
								  <span class="ttle">Groepsgrootte</span>
								  <p><?php the_field('groepsgrootte');?></p>
							  </div>
						  </div>
						  <?php endif; ?>
						  <?php if(get_field('certificaat')):?>
						   <div class="row certificaat">
							  <div class="col-xs-2 col-sm-2 col-md-1 pdngrghnul">
							  	<?php echo file_get_contents(get_template_directory_uri()."/assets/img/certificaat.svg"); ?>
							  </div>
							  <div class="col-xs-10 col-sm-10 col-md-11">
								  <span class="ttle">Certificaat</span>
								  <p><?php the_field('certificaat');?></p>
							  </div>
						  </div>
						  <?php endif; ?>
					  </div>
				  </div>
				  <div class="tab-pane fade" id="inhoud" role="tabpanel" aria-labelledby="inhoud-tab">
					  <?php the_field('inhoud');?>
				  </div>
				  <div class="tab-pane fade" id="data" role="tabpanel" aria-labelledby="data-tab">
					  <?php if(get_field('tekst_boven_plaats_en_data')): the_field('tekst_boven_plaats_en_data'); endif;
					   if($repeater && $datum ):
					   else:
					   echo "Voor deze cursus zijn momenteel geen data gepland. Neem via onderstaand formulier contact met ons op voor meer informatie over de mogelijkheden.";
						  echo do_shortcode('[gravityform id="5" title="false" description="false" ajax="true" tabindex="65655323232232121"]');
						  endif; ?>
					
				  </div>
				</div>
				<?php 

if( $datum && $repeater ): ?>
<div id="shwdata" style="height: 0px; overflow: hidden;">
	<table id="data" class="tablesorter-blue">
		<thead>
		    <tr>
		      <th class="group-word">Plaats</th>
		      <th class="group-false sorter-false">Data</th>
		      <th class="group-false sorter-false"></th>
		    </tr>
		  </thead>
		  <tbody>
	<?php foreach( $repeater as $i => $row ): 
		$vandaag = strtotime(date('Ymd'));
		//echo $vandaag.'---';
		$str_datum = strtotime($row['start_datum']);
		//echo $str_datum;
		if ($str_datum >= $vandaag): ?>
		<tr>
			<td><?php echo $row['plaats']; if($row['last_minute']):?> <span class="lbl">Last minute</span><?php endif;?></td>
			<td><?php echo $row['training_data']; ?></td>
			<td>
			<?php if($row['last_minute']):?>
			<a href="<?php echo the_permalink($row['last_minute_post']);?>">Bekijk training > </a>
			<?php else: ?>
			<a href="/inschrijven?plaats=<?php echo $row['plaats']; ?>&start=<?php echo $row['start_datum']; ?>&eind=<?php echo $row['eind_datum']; ?>&training=<?php the_title();?><?php if(get_field('examen_mogelijkheid')):?>&examen=examen<?php endif; ?>">Inschrijven > </a>
			<?php endif; ?>
			</td>
		</tr>
	<?php endif; ?>
	<?php endforeach; ?>
		  </tbody>
	</table>
</div>
<?php endif; ?>
			</div>
			<div class="col-xs-12 col-sm-12 col-md-4" id="sidebar">	
				<a class="hidden-xs hidden-sm ovrzcht" href="javascript:history.back()">Terug naar overzicht</a>
					
				<div class="rnd smry">
					<div class="tpcntnt">
						<span class="ttle"><?php the_title();?></span>
						<div class="row">
							<div class="col-xs-4 col-sm-4 col-md-4">
						<?php echo file_get_contents(get_template_directory_uri()."/assets/img/klassikaal.svg"); ?>
							</div>
							<div class="col-xs-8 col-sm-8 col-md-8 rhgt">
								<?php if(get_field("prijs_op_aanvraag")):?>
								<span>Prijs op aanvraag</span>
								<?php else:?>
								<sup style="padding-right: 5px;"><?php if(get_field("vanaf_prijs")):?>Vanaf  </sup><?php endif; ?>
								<span>&euro; <?php the_field('prijs');?></span><br/><span class="small">(excl. BTW)</span>
							 <?php endif; ?>
							</div>
						</div>
					</div>
					<div class="mdlcntnt">
						<a class="inschr" href="<?php the_permalink();?>#data">Direct inschrijven</a>
					</div>
					<div class="btmcntnt">
						<span class="ttle">Deze cursus in het kort</span><br/>
						<?php the_field('in_het_kort');?>
					</div>
					<form class="form-horizontal" id="" role="form" action="" method="post">
					    <button type="submit" class="dwnld">
					        <?php echo file_get_contents(get_template_directory_uri()."/assets/img/pdficn.svg"); ?> Download informatie
					    </button>
					    <input type="hidden" name="action" value="generate-one-sheet" />
					    <input type="hidden" name="postid" value="<?php echo get_the_ID(); ?>" />
					    <?php wp_nonce_field('verify_generate_one_sheet','nonce_generate_one_sheet'); ?>
					</form>
				</div>
				
				<?php if(get_field("toon_klassikale_training")):?>
				<div class="rnd klskl">
					<div class="tpcntnt">
						<div class="row">
							<div class="col-xs-4 col-sm-4 col-md-4">
								<?php echo file_get_contents(get_template_directory_uri()."/assets/img/klassikaal.svg"); ?>
							</div>
							<div class="col-xs-8 col-sm-8 col-md-8 rhgt">
								 <span class="ttle">Klassikale training</span>
							</div>
						</div>
					</div>
					<div class="mdlcntnt">
						<?php if(get_field("aangepaste_link_klassikaal")):?>
						<a class="inschr" href="<?php the_field("button_link_klassikaal"); ?>"><?php if (get_field("button_tekst_klassikaal")): the_field("button_tekst_klassikaal"); else: ?>Meer informatie<?php endif; ?></a>
						<?php else: ?>
						<a class="inschr" href="/offerte-aanvragen/?leervorm=klassikaal&training=<?php the_title();?>">Offerte aanvragen</a>
						<?php endif; ?>
					</div>
					<?php if(get_field("tekst_klassikaal")):?>
					<div class="btmcntnt">
						<p><?php the_field("tekst_klassikaal"); ?></p>
					</div>
					<?php endif; ?>
				</div>
				<?php endif; ?>
				<?php if(get_field("toon_prive_cursus")):?>
				<div class="rnd elrng">
					<div class="tpcntnt">
						<div class="row">
							<div class="col-xs-4 col-sm-4 col-md-4">
								<?php echo file_get_contents(get_template_directory_uri()."/assets/img/privecursus.svg"); ?>
							</div>
							<div class="col-xs-8 col-sm-8 col-md-8 rhgt">
								 <span class="ttle">Privécursus</span>
							</div>
						</div>
					</div>
					<div class="mdlcntnt">
						<?php if(get_field("aangepaste_link_prive")):?>
						<a class="inschr" href="<?php the_field("button_link_prive"); ?>"><?php if (get_field("button_tekst_prive")): the_field("button_tekst_prive"); else: ?>Meer informatie<?php endif; ?></a>
						<?php else: ?>
						<a class="inschr" href="/offerte-aanvragen/?leervorm=privecursus&training=<?php the_title();?>">Offerte aanvragen</a>
						<?php endif; ?>
					</div>
					<?php if(get_field("tekst_prive")):?>
					<div class="btmcntnt">
						<p><?php the_field("tekst_prive"); ?></p>
					</div>
					<?php endif; ?>
				</div>
				<?php endif; ?>
				<?php if(get_field("toon_elearning")):?>
				<div class="rnd prvcrs">
					<div class="tpcntnt">
						<div class="row">
							<div class="col-xs-4 col-sm-4 col-md-4">
								<?php echo file_get_contents(get_template_directory_uri()."/assets/img/elearning.svg"); ?>
							</div>
							<div class="col-xs-8 col-sm-8 col-md-8 rhgt">
								 <span class="ttle">E-learning</span>
							</div>
						</div>
					</div>
					<div class="mdlcntnt">
						<?php if(get_field("aangepaste_link_elearning")):?>
						<a class="inschr" href="<?php the_field("button_link_elearning"); ?>"><?php if (get_field("button_tekst_elearning")): the_field("button_tekst_elearning"); else: ?>Meer informatie<?php endif; ?></a>
						<?php else: ?>
						<a class="inschr" href="/offerte-aanvragen/?leervorm=elearning&training=<?php the_title();?>">Offerte aanvragen</a>
						<?php endif; ?>
					</div>
					<?php if(get_field("tekst_elearning")):?>
					<div class="btmcntnt">
						<p><?php the_field("tekst_elearning"); ?></p>
					</div>
					<?php endif; ?>
				</div>
				<?php endif; ?>
			</div>
		</div>
	</div>
</div>
<?php $post_objects = get_field('gerelateerde_trainingen');

if( $post_objects ): ?>
<div class="container-fluid rltd" style="background-image: linear-gradient(to right, rgba(0,0,0,0.5) 0%,rgba(0,0,0,0.5) 1%,rgba(0,0,0,0.5) 100%,rgba(0,0,0,0.5) 100%), url('<?php echo get_template_directory_uri(); ?>/assets/img/vervolg.jpg'); background-repeat: no-repeat; background-position: center center; background-size: cover;">
	<div class="container">
		
		<div class="row">
			<div class="col-xs-12 col-sm-12 col-md-12">	
				<h2>Gerelateerde trainingen</h2>
			</div>
		</div>
		<div class="row">
    <?php foreach( $post_objects as $post):
      setup_postdata($post);  
$locs = get_the_terms( get_the_ID(), 'leervormen' );
if ( $locs && ! is_wp_error( $locs ) ) : 
    $gekoppelde_locaties = array();
	$gekoppelde_locatiesslug = array();
	foreach ( $locs as $loc ) {
	$gekoppelde_locaties[] = $loc->name;
	$gekoppelde_locatiesslug[] = $loc->slug;
	}                   
	$spangekoppelde_locaties = join( ", ", $gekoppelde_locaties );
	$gekoppelde_locatiesslug = join( ", ", $gekoppelde_locatiesslug );
endif;
	$prijs = get_field('prijs'); 
	$prijs_korting = get_field('prijs_inclusief_korting');
	$duur_aantal = get_field('duur_aantal');
	$duur_soort = get_field('duur_soort');
	$repeater = get_field('plaats_en_data');
		if($repeater):
				$locaties = array();
				foreach( $repeater as $i => $row ):
					$locaties[] = $row['plaats'];
				endforeach; 
				$aantal_locaties = join( ", ", $locaties );
		endif;?>
       <div class="col-xs-12 col-sm-12 col-md-12 trngs">	
	<a href="<?php the_permalink();?>">
				<div class="cntntup">
					<?php if( has_term( 'Last minute', 'training_extra', get_the_ID() )) { echo file_get_contents(get_template_directory_uri()."/assets/img/last_minute.svg"); } else {};?> <h3><?php the_title();?></h3> <span class="rng"><?php if($repeater){ if (count($locaties) === 1): echo "".$aantal_locaties; else: echo "meerdere locaties"; endif; } else {};?></span><span class="rght"><i class="fas fa-chevron-right"></i></span>
				</div>
				<div class="cntntdwn">
					<?php /*echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_agenda.svg");  25-09-2018 <span class="sp">|</span> */?><?php if($duur_aantal): echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_duur.svg"); echo $duur_aantal; echo " ".$duur_soort; ?>  <span class="sp">|</span><?php endif; ?> <?php if($spangekoppelde_locaties): echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_doelgroep.svg"); ?> <?php echo $spangekoppelde_locaties; endif; ?> <?php if($prijs_korting || $prijs):?><span class="sp">|</span> <?php echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_euro.svg"); if($prijs_korting):?><span class="rd"><strike><?php echo $prijs;?></strike></span><span class="bl"> voor &euro; <?php echo $prijs_korting; ?></span><?php else: ?><?php echo $prijs;?><?php endif; endif; ?>
				</div>
	</a>
			</div>
    <?php endforeach; ?>
    <?php wp_reset_postdata();?>
</div>
		
	</div>
</div>
<?php endif; ?>

<?php get_footer(); ?>

In overzichten

<div class="row">
<?php while (have_posts()) : the_post(); ?>
<?php $locs = get_the_terms( get_the_ID(), 'leervormen' );
if ( $locs && ! is_wp_error( $locs ) ) : 
    $gekoppelde_locaties = array();
	$gekoppelde_locatiesslug = array();
	foreach ( $locs as $loc ) {
	$gekoppelde_locaties[] = $loc->name;
	$gekoppelde_locatiesslug[] = $loc->slug;
	}                   
	$spangekoppelde_locaties = join( ", ", $gekoppelde_locaties );
	$gekoppelde_locatiesslug = join( ", ", $gekoppelde_locatiesslug );
endif; ?>
<?php 
	$prijs = get_field('prijs'); 
	$prijs_korting = get_field('prijs_inclusief_korting');
	$duur_aantal = get_field('duur_aantal');
	$duur_soort = get_field('duur_soort');
	$repeater = get_field('plaats_en_data');
		if($repeater):
				$locaties = array();
				$traindta = array();
				foreach( $repeater as $i => $row ):
					$locaties[] = $row['plaats'];
					$traindta[] = $row['training_data'];
				endforeach; 
				$aantal_locaties = join( ", ", $locaties );
				$training_data = join( ", ", $traindta );
		endif;
				?>
<div class="col-xs-12 col-sm-12 col-md-12 trngs <?php if( has_term( 'Last minute', 'training_extra', get_the_ID() )):?>lstmnt<?php endif; ?>">	
	<a href="<?php the_permalink();?>">
				<div class="cntntup">
					<?php if( has_term( 'Last minute', 'training_extra', get_the_ID() )) { echo file_get_contents(get_template_directory_uri()."/assets/img/last_minute.svg"); } else {};?> <h3><?php the_title();?></h3> <span class="rng"><?php if($repeater){ if (count($locaties) === 1): echo "".$aantal_locaties; else: echo "meerdere locaties"; endif; } else {};?></span> <span class="rght"><i class="fas fa-chevron-right"></i></span>
				</div>
				<div class="cntntdwn">
					<?php /*echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_agenda.svg");  25-09-2018 <span class="sp">|</span> */?><?php if($duur_aantal): echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_duur.svg"); echo $duur_aantal; echo " ".$duur_soort; ?>  <span class="sp">|</span><?php endif; ?> <?php if($spangekoppelde_locaties): echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_doelgroep.svg"); ?> <?php echo $spangekoppelde_locaties; endif; ?> <?php if( has_term( 'Last minute', 'training_extra', get_the_ID()) ): echo '<span class="sp">|</span> <span style="display: inline-block;">'. file_get_contents(get_template_directory_uri()."/assets/img/overzicht_agenda.svg") . $training_data.'</span>'; endif;?> <?php if($prijs_korting || $prijs):?><span class="sp">|</span> <span style="display: inline-block;"><span class="esgn"><?php echo file_get_contents(get_template_directory_uri()."/assets/img/overzicht_euro.svg");?></span><?php if($prijs_korting):?><span class="rd"><strike><?php echo $prijs;?></strike></span><span class="bl"> voor &euro; <?php echo $prijs_korting; ?></span><?php else: ?><?php echo $prijs;?><?php endif; ?> </span><?php endif; ?>
				</div>
	</a>
			</div>
<?php endwhile; ?>
</div>

 

 

Geef een reactie 0