<?php

/**
 * Provide a public-facing view for the plugin
 *
 * This file is used to markup the public-facing aspects of the plugin.
 *
 * @link       https://orbicular.media
 * @since      1.1.0
 *
 * @package    Cemetery_Sexton
 * @subpackage Cemetery_Sexton/public/partials
 */
?>

<h4> <i class="fas fa-map-marked-alt"></i> Lot Information</h4>
<h3><?php echo $lotLocation; ?></h3>
<div class="fammon-photos-row">
<?php   
    // Get interment photo
    $fammons = $lotData->lot_displayFammon($LotID);
    echo $fammons;
    ?>
</div>
<table class="cemetery-sexton-results-list">
	<thead>
		<tr>
			<th class="title" id="header-name">Name</th>
			<th class="title" id="header-dob">Date of Birth</th>
			<th class="title" id="header-dod">Date of Death</th>
		</tr>
	</thead>
	<?php
	foreach ($sameLot as $rsSameLot){
	    //$link = '?pagename=interment&InterID='. $rsSameLot['InterID'];
	    //$redirect = get_site_url(null, $link);
	    $redirect = esc_html( add_query_arg( 'InterID', $rsSameLot['InterID'], get_permalink(get_option('cemetery-sexton')['page_interment']) ) );
	    ?>
		<tr>
			<td class="result-name"><a href="<?php echo $redirect; ?>"><?php echo $rsSameLot['FirstName'].' '.$rsSameLot['MidName'].' '.$rsSameLot['LastName'].' '.$rsSameLot['Suffix']; ?></a></td>
			<td class="result-date"><a href="<?php echo $redirect; ?>"><?php echo $tools->tools_dateFormat($rsSameLot['DateBirth']); ?></a></td>
			<td class="result-date"><a href="<?php echo $redirect; ?>"><?php echo $tools->tools_dateFormat($rsSameLot['DateDeath']); ?></a></td>
		</tr>
		<?php }	?>
	</tbody>
</table>
