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/vanlierop/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","subtitel","tekst"),
				//array("html")
				);
	$search_values	= $_GET["q"];
	
	
	/*
	 * Get data
	 */
	$refine_search 	= array();
	$view_page 		= isset($_GET["show"]) ? $_GET["show"] : 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->getEntries(null,null,$se["unique_id"]);
		
		$first_field = $ed[0]->first_field;
		
		$rslt .= '<div class="small-12 columns"><div class="result-row">';
				
			$rslt .= '<h4><a href="'. $ed[0]->entry_link .'">'. ucfirst($ed[0]->$first_field) .'</a></h4>'; //$se["relevance"]
			$rslt .= '<p><em>'. preg_replace("/http:\/\//","",$cassette->getBaseUrl() ).$ed[0]->entry_link .'</em></p>';
			$rslt .= '<p>'. $cassette->makeIntro($ed[0]->tekst,240,null,' ...') .'</p>';
				
		$rslt .= '</div></div>';
	}
	
	// spacer
	$html = '<div class="row expanded row-default"><section id="igghrokuhc" class=""><div class="col24"><br /></div></section></div>';
	
	$html .= '<div class="row">';
	
		$html .= '<div class="small-12 columns text-center">';
			$html .= '<form class="form" action="'. $cassette->getBaseUrl() . $cassette->getLinkBase() .'search" method="get">';
				$html .= '<h1>'. $cassette->getSearchHeader() .'</h1>';
				$html .= '<div class="input-group">';
					$html .= '<input type="text" name="q" value="'. $cassette->outputSafe($_GET["q"]) .'" id="q" class="input-group-field" placeholder=""/>';
					$html .= '<div class="input-group-button"><button type="submit" class="button primary">'. $cassette->getSearchPlaceHolder() .'</button></div>';
				$html .= '</div><br />';
			$html .= '</form>';
		$html .= '</div>';
		

	
	
		$html .= $cassette->product_count > 0 ? $rslt : '<div class="small-12 columns">'. $cassette->getNoResultsheader($_GET["q"]) .'</div>';
	
	$html .= '</div>';
	
	// pagination		
	$page_link 		= 'search?q='. $cassette->vl($_GET["q"]);
	$current_page	= (isset($_REQUEST["show"])) ? $_REQUEST["show"] : 1;
	$hide_first 	= false;
	$hide_last 		= false;	
	
	$html .= '<div class="col24"><br /><ul class="pagination">';
		$start 	= $cassette->product_pagination > 20 ? $_REQUEST["show"]-10 : 1;
		$end 	= $cassette->product_pagination > 20 ? ($_REQUEST["show"]+10) : $cassette->product_pagination;
	
		if($start <= 1)
		{
			$hide_first = true;
			$start = 1;	
		}
		
		if($end >= $cassette->product_pagination)
		{
			$hide_last = true;	
			$end = $cassette->product_pagination;
		}
		
		if($hide_first == false) $html .= '<li><span class="disabled">...</span></li>';
		for($i=$start; $i<= $end; $i++)
		{	
			if(isset($_REQUEST["show"]) && $_REQUEST["show"] == $i || !isset($_REQUEST["show"]) && $i == 1) $html .= '<li><span class="current">'.$i.'</span></li>';
			else $html .= '<li><a href="'.$page_link.'&show='.$i.'">'.$i.'</a></li>';	
		}
		
		if($hide_last == false) $html .= '<li><span class="disabled">...</span></li>';
	$html .= '</ul></div>';

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