<?php
session_start();

$path = $_SERVER['DOCUMENT_ROOT'];
include_once($path."/microsite_functions.php");
include_once($path."/collections/functions_collections.php");
require_once($path.'/collections/classes/Pagination2023.Bootstrap.class.php');
require_once($path.'/collections/classes/FacetBuilder2023.class.php');
include_once($path."/collections/classes/CollectionsFunctions2023.class.php");
include_once($path."/collections/classes/RecordTemplater2023.class.php");
require_once($path.'/collections/new/SolrUrlBuilder.class.php');

$FacetBuilder = new FacetBuilder2023();
$SolrUrlBuilder = new SolrUrlBuilder();
$Pagination = new Pagination();
$CollectionsFunctions2023 = new CollectionsFunctions2023();

if(!isset($_GET['page']) || !ctype_digit($_GET['page'])) { $page = 1; }
else{ $page = (int) $_GET['page']; }

$placename_id = 6785;

try
{
	$curl_string = $SolrUrlBuilder->getLocation('sitio+conte');
    $resp = solrCurl($curl_string);
	$result = json_decode($resp, true);

	$response_status = $result['responseHeader']['status'];
	$num_found = $result['response']['numFound'];
	$start_record = $result['response']['start'];
	$documents = $result['response']['docs'];
	$facets = $result['facet_counts']['facet_fields'];

	if($num_found > 0)
	{
		$paginagtion_html = $Pagination->getPagination($page, $num_found, 30, $_SERVER['SCRIPT_NAME'].'?'.$SolrUrlBuilder->getStrippedQueryString(), "search");
		$RecordTemplater =  new RecordTemplater2023();
		$results = $RecordTemplater->displayResultset($documents);
	}
	else { $paginagtion_html = '';	}
	if($response_status !== 0) { echo 'Something went Wrong :('; }

}
catch(Exception $e){ echo CollectionsFunctions::get_exception_text(); }

$MetaDescription = 'In 1940, the Penn Museum excavated the now-famous Sitio Conte (Conte Site) and found archaeological evidence of a large cemetery including an impressive burial of a chief that had been buried with lots of gold and numerous other individuals.';
$Keywords = 'Panama, Rio Grande de Coclé, gold, Quevi culture';
$Title = 'Sitio Conte - Highlights | Digital Collections';

$collections->get_Header($Keywords,$MetaDescription,$Title);
$collections->get_Microsite_menu($myfinds = true);
?>

<section class="pb-0">
	<div class="main-container">
		<?php echo get_Breadcrumb('/collections', 'Online Collections'); ?>
		<h1>Sitio Conte, Panama</h1>
		<?php echo get_Hero_Img('/collections/highlights/american/location/img/sitioconte-lg.jpg', 'Work being done at Sitio Conte.', ''); ?>
	</div>
</section>
<section class="pt-5">
	<div class="main-container">
		<div class="row g-2 pt-5">
			<div class="left-rail">
				<div style="width: 100%; height: 300px" id="map"></div>
			</div>
			<div class="right-rail ms-0">
				<p class="text-lg">Located in central Panama, the Rio Grande de Coclé floods during the rainy season. In the early 20th century, the Conte family noticed that the shifting course of the river was exposing ancient burials on the river’s edge. In 1940, the Penn Museum excavated the now-famous Sitio Conte (Conte Site) and found archaeological evidence of a large cemetery including an impressive burial of a chief that had been buried with lots of gold and numerous other individuals. The evidence, although dating to the late 1st millennium CE, seemed to corroborate Spanish accounts of events and rituals surrounding the burial of powerful chiefs for the Quevi culture in the late 16th century CE.</p>
			</div>
		</div>
	</div>
</section>
<section class="collections-search-results pt-5">
	<div class="main-container">
		<div class="row g-2">
			<div class="left-rail">
				<div class="collections-facets accordion-item">
					<button id="accordion-title-accordion" class="accordion-title" tabindex="0" aria-expanded="true" aria-controls="accordion-panel-accordion">
						<div class="accordion-arrow">
							<span class="accordion-arrow-item">
								<img src="https://collections.penn.museum/img/brand/svg/arrow-down.svg" alt="">
							</span>
						</div>
						<h4>Search Result Filters</h4>
					</button>
					<div class="accordion-content ps-0" id="accordion-panel-accordion" aria-labelledby="accordion-title-accordion">
						<div class="accordion">
							<div class="accordion-text w-100">
							<?php $FacetBuilder->displayFacets($facets); ?>
						</div>
						</div>
						
					</div>
				</div>
			</div>
			<div class="right-rail">
				<div class="row g-2 mb-4">
					<div class="left-rail-wide">
						<?php echo $FacetBuilder->getFacetRemovalLinks($SolrUrlBuilder->getQueryArray()); ?>
					</div>
					<div class="right-rail-narrow">
						<?php echo $Pagination->calculate_records($page, $num_found, 30, $_SERVER['SCRIPT_NAME'].'?'.$SolrUrlBuilder->getStrippedQueryString(), "search"); ?>
					</div>
				</div>
				<div class="row g-1 four-up pb-5">
					<?php foreach ($results as $result) {
						echo $result;
					}  ?>
				</div>
				<?php echo $paginagtion_html; ?>
			</div>
		</div>
	</div>
</section>

	
<?php get_Footer($CollectionsFunctions2023->getCollectionsJS().'<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYrqTpG5F1ZU0DwZP6IY736X8TJykqYAY&callback=initMap"></script><script type="text/javascript">
jQuery(document).ready(function() {
    initialize();

    function initialize() {
    	var uluru = {lat: 8.329575, lng: -80.400208};

        var mapOptions = {
            center: uluru,
            zoom: 11
        };
        
        var map = new google.maps.Map(document.getElementById("map"), mapOptions);
        var marker = new google.maps.Marker({
          position: uluru,
          map: map
        });

    }
});
</script>');  ?>
