HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/test.creativefellows.nl/ergatis/pages/page.search.php
<?php
	

	/* 
	 * Do Search with post values
	 */
	$tables	= array(
				//"unique_id" => "td_page",
				"page_id" 	=> "page_section_content"
				);
	$pars	= array(
				//array("titel"),
				array("html")
				);
	$search_values	= $_GET["q"];
	

	/*
	 * Get data
	 */
	$refine_search 	= array();
	$view_page 		= isset($_GET["p"]) ? $_GET["p"] : 1;
	$search_tables	= array();
	
	$search_entries	= $cassette->getSearchResults($tables,$pars,$search_values,$refine_search,$view_page,null,true);
	

	/*
	 * Search Results
	 */
	$rslt = '';	
	foreach((array) $search_entries as $se)
	{
		$ed = $cassette->entries(null,null,$se["unique_id"]);
		$first_field = $ed[0]->first_field;
		
		$rslt .= '<div class="result-row col24">';
				
			$rslt .= '<h4><a href="'. $ed[0]->entry_link .'">'. $ed[0]->$first_field .'</a></h4>'; //'.$se["relevance"] .'
			$rslt .= '<p><em>'. preg_replace("/http:\/\//","",$cassette->base).$ed[0]->entry_link .'</em></p>';
			$rslt .= '<p>'. $cassette->makeIntro($ed[0]->content,240,null,' ...') .'</p>';
				
		$rslt .= '</div>';
	}
	

	
	$html = '<div class=""><form class="form col24" action="'. $cassette->link_base .'search" method="get"><div>';
	$html .= '<h1>Zoekresultaten</h1>';
		$html .= '<div class="col24 sub-grid">';
			$html .= '<input type="text" name="q" value="'. $cassette->outputSafe($_GET["q"]) .'" id="q" class="input autocomplete" placeholder=""/>';
			$html .= '<button type="submit" class="button primary">'. $cassette->search_placeholder .'</button>';
		$html .= '</div>';
	
	$html .= '</div></form></div>';
	
	
	$html .= $cassette->product_count > 0 ? $rslt : '<div class="result-row col24"><strong>Geen zoekresultaten gevonden</strong></div>';
	
	// pagination		
	if($cassette->product_pagination)
	{
		$page_link 		= 'search?q='. $cassette->vl($_GET["q"]);
		$current_page	= (isset($_GET["p"])) ? $_GET["p"] : 1;
		$hide_first 	= false;
		$hide_last 		= false;	
		
		
		$html .= '<div class="col24"><br /><ul class="pagination">';
			$start 	= $cassette->product_pagination > 20 ? $_GET["p"]-10 : 1;
			$end 	= $cassette->product_pagination > 20 ? ($_GET["p"]+10) : $cassette->product_pagination;
		
			$nextlink 		= ($current_page < $cassette->product_pagination) ? '<li class="next"><a href="'.$page_link.'&p='.($current_page+1).'">Volgende</a></li>' : '<li class="next"><span class="disabled">Volgende</span></li>';
			$prevlink 		= ($current_page > 1) ? '<li class="prev"><a href="'.$page_link.'&p='.($current_page-1).'">Vorige</a></li>' : '<li class="prev"><span class="disabled">Vorige</span></li>';
		
	
			if($start <= 1)
			{
				$hide_first = true;
				$start = 1;	
			}
		
			if($end >= $cassette->product_pagination)
			{
				$hide_last = true;	
				$end = $cassette->product_pagination;
			}
		
			$html .= $prevlink;
			if($hide_first == false) $html .= '<li><span class="disabled">...</span></li>';
			for($i=$start; $i<= $end; $i++)
			{	
				if(isset($_GET["p"]) && $_GET["p"] == $i || !isset($_GET["p"]) && $i == 1) $html .= '<li><span class="current">'.$i.'</span></li>';
				else $html .= '<li><a href="'.$page_link.'&p='.$i.'">'.$i.'</a></li>';	
			}
		
			if($hide_last == false) $html .= '<li><span class="disabled">...</span></li>';
			$html .= $nextlink;
		$html .= '</ul></div>';

	
	}
	

	/*
	 * Output to page
	 */
	echo $cassette->wrapAsSection($html,"","search-results");
	
	
	
?>