<div class="container">
	<div class="row">
		<div class="col">
			<h4><b>Experience In SALIHIN</b></h4>
			<!-- <small><b style="color: red;">*Please add/update your Experience In SALIHIN</b></small> -->
		</div>
	</div>

	<div class="row"> 
		<div class="col">
			<table class="table table-bordered">
				<thead>
					<tr>
						<th>Date</th>
						<th>Task Description</th>
						<th>Nature of Engagement</th>
						<th>Engagement Period</th>
					</tr>
				</thead>
				<tbody>	

					<?php if($working_experience) foreach ($working_experience as $key => $wp): 

						// $engagement_diff = $wp->engagement_period_to->diff($wp->engagement_period_from)->format('%a');
					// debug($wp);
						$date_from	= new DateTime(($wp->engagement_period_from > 0)?date('Y-m-d H:i:s',strtotime($wp->engagement_period_from)):'0000-00-00 00:00:00');
						$date_to	= new DateTime(($wp->engagement_period_to > 0)?date('Y-m-d H:i:s',strtotime($wp->engagement_period_to)):'0000-00-00 00:00:00');
						$engagement_diff = $date_to->diff($date_from)->format('%a');

						$years 	= floor(($engagement_diff / 365)); // days / 365 days
						$months = floor(($engagement_diff % 365) / 30);
						$days  	= ($engagement_diff % 365) % 30;

						$year_text = ($years > 0)?$years.' year ':'';
						$month_text = ($months > 0)?$months.' month ':'';
						$day_text = ($days > 0)?$days.' day ':'';

					?>
					<tr class="link-row" data-id="<" >
						<td><?php echo date('d-m-Y',strtotime($wp->date_from)).' - '.date('d-m-Y',strtotime($wp->date_to)); ?></td>
						<td><?php echo nl2br($wp->experience); ?></td>
						<td><?php echo nl2br($wp->nature_engagement); ?></td>
						<td><?php echo $year_text.$month_text.$day_text; ?></td>
					</tr>						
				<?php endforeach ?>						

			</tbody>
			</table>
		</div>
	</div>
</div>